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 hangs when returning an array #1250

Closed
shafreenAnfar opened this issue Apr 16, 2021 · 0 comments · Fixed by ballerina-platform/module-ballerina-graphql#178
Closed
Assignees
Labels
module/graphql Issues related to Ballerina GraphQL module Priority/High Team/PCM Protocol connector packages related issues Type/Bug

Comments

@shafreenAnfar
Copy link
Contributor

Program

import ballerina/graphql;

service /graphql on new graphql:Listener(9000) {
    resource function get allLifts(string status) returns Lift[] {
        return [new Lift()];               
    }
}

service class Lift {

    resource function get id () returns string|error {
        return "l1";
    }

    resource function get name () returns string|error {
        return "lift1";
    }
}

Request

curl -X POST -H "Content-Type: application/json" --data '{ "query": "{ allLifts(status:\"OPEN\") { name } }" }' http://localhost:9000/graphql

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 Priority/High Team/PCM Protocol connector packages related issues Type/Bug
Projects
None yet
2 participants