-
Notifications
You must be signed in to change notification settings - Fork 758
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
Needs to get the default value of an input parameter in a resource function #30106
Comments
Do you need this during the runtime or compile time? Default values will be captured as closures. So you can't get a value unless it is a constant value during the compile time. At runtime, you have to manually evaluate the closure to get the value. But that is dangerous because closures can mutate the state. Can you summarize the use case here? |
Currently, we create the GraphQL schema for a given service at the runtime, since we don't have a direct way to create the schema at the compile time and propagate that to the runtime. The use case of this specific scenario is that we need the default values of the input parameters to support GraphQL introspection. When a resource function has an input parameter, it maps to an InputValue type in GraphQL. If there is a default value for that input value, GraphQL clients should be able to query the GraphQL endpoint and view the default value of a given input value. Currently, we do not have a way to get this default value. (ballerina-platform/ballerina-library#1377) |
Any update on this? |
@chiranSachintha Can we do this after function default value change? I mean technically jBallerina backend team only need to provide an API to access the closures right? |
Hi, any update on this? |
@warunalakshitha can you look into this? |
Any update on this? We cannot fix ballerina-platform/ballerina-library#1377 without this. |
We are still working on passing default values to runtime( Can be tracked via #36020) We will update on the progress |
Closing the issue since #36020 is done. |
Description:
When there is an input parameter with a default value in a resource function, there should be a way to get the default value of this parameter. This is a requirement for the Ballerina GraphQL package implementation.
Related: #27417, ballerina-platform/ballerina-library#1266
The text was updated successfully, but these errors were encountered: