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

Optional Enum Input Parameter is Invalidated in the Compiler Plugin. #1350

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

Comments

@ThisaruGuruge
Copy link
Member

Description:
For the GraphQL resources, we can have string, int, boolean, float, or enum as input parameters. It should be valid to have any of these parameter type unionized with nil (Optional parameter). But currently, when an input is an optional enum, the compiler is throwing an error.

Consider the following example:

public enum Bar {
    BAZ,
    ZAB,
    DOO
}

resource function get foo(Bar? bar) returns Foo {
    // ....
}
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
Development

Successfully merging a pull request may close this issue.

2 participants