Generate the part of the Schema programmatically and the rest via @GraphQLApi #2887
-
Right now I have defined several calls in my API simply by doing something like this:
Here the fields in the I have a situation where the fields that can be returned by my code should be determined at startup (they can vary depending on system configuration). I've been trying to understand the documentation on this subject (i.e. https://www.graphql-java.com/documentation/schema#creating-a-schema-programmatically ) yet these all seem to work in a situation without the use of the annotations like @GraphQLAPI. Also the tutorial https://www.graphql-java.com/tutorials/getting-started-with-spring-boot/ works in a radically different way. I'm looking for a simple Java example that shows me how I can have most code just work with the @GraphQLAPI (which obtains the schema through annotations and reflection) and a single API/Query and related parts of the schema that are done programatically. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Via a different route @bbakerman showed me this which answers my question |
Beta Was this translation helpful? Give feedback.
-
The annotations you're using seem to coming from MicroProfile GraphQL, and not graphql-java? Am I correct? |
Beta Was this translation helpful? Give feedback.
Via a different route @bbakerman showed me this which answers my question
https://www.graphql-java.com/documentation/schema/#changing-schema