Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Service Crashes When the Provided Map Key is not Present in the Map Type #3227

Closed
ThisaruGuruge opened this issue Aug 8, 2022 · 0 comments · Fixed by ballerina-platform/module-ballerina-graphql#864
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Points/0.5 Reason/Regression The issue has introduced a regression. Team/PCM Protocol connector packages related issues Type/Bug

Comments

@ThisaruGuruge
Copy link
Member

Description:
Check the following code:

import ballerina/graphql;

service on new graphql:Listener(4000) {    
    resource function get person() returns Person {
        return {
            names: {
                one: "One",
                two: "Two"
            },
            id: 1
        };
    }
}

public type Person record {|
    map<string> names;
    int id;
|};

When the following document is sent to the GraphQL service, it crashes.

{
  person {
    names(key:"kja")
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/graphql Issues related to Ballerina GraphQL module Points/0.5 Reason/Regression The issue has introduced a regression. Team/PCM Protocol connector packages related issues Type/Bug
Projects
Archived in project
1 participant