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

Revisit Resource Functions Returning Service Objects Functionality #763

Closed
ThisaruGuruge opened this issue Dec 17, 2020 · 0 comments · Fixed by ballerina-platform/module-ballerina-graphql#87
Labels
module/graphql Issues related to Ballerina GraphQL module Points/1.5 Type/Improvement

Comments

@ThisaruGuruge
Copy link
Member

ThisaruGuruge commented Dec 17, 2020

Currently, the Ballerina GraphQL module supports resource functions that return dynamic service objects. But as per the discussion with James, we should not support this. Instead, we should support typed services only.

For example, the following should not be allowed:

import ballerina/graphql;

service graphql:Service on new graphql:Listener(9090) {
    resource function get profile() returns service object {} {
        return new service object {
            resource function get name() returns string {
                return "Sherlock";
            }
        }
    }
}

Instead, when a user needs to return service from a resource function, they should define a service type.

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/1.5 Type/Improvement
Projects
None yet
1 participant