-
|
I'm struggling a bit with understanding the difference between the RuntimeWiring and the GraphQLCodeRegistry. My current understanding is that the RuntimeWiring is just used to create a GraphQLCodeRegistry, but I suspect that's not completely correct. The reason why I ask is that we're trying to gradually get rid of GraphQL Java Kickstart in favor of writing DataFetchers directly. It's quite easy to extract the GraphQLCodeRegistry from the GraphQLSchema that Kickstart creates for us, but I can't reach the RuntimeWiring. Thus the question: Is there an easy way to create a GraphQLSchema by combining our schema files (SDL) with a GraphQLCodeRegistry, or must we go via a RuntimeWiring? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
The runtime wiring is used to help create the "runtime aspects" of a schema - eg data fetchers and type resolvers It is used when you create a schema from a text file, eg from Schema Definition Language (SDL) https://www.graphql-java.com/documentation/schema#creating-a-schema-using-the-sdl Nominally the runtime wiring is asked via a call back "do you have a data fetcher" field this field and if so it puts it into the However you can supply in a The reason we have both a RuntimeWiring and a https://www.graphql-java.com/documentation/schema#creating-a-schema-programmatically To your specially question
not really not - the SchemaGenerator does LOTS of work to take a simple parsed TypeDefinitionRegistry and turn it into a valid schema. If you were to take a TypeDefinitionRegistry and GraphQLCodeRegistry and try to make a schema then you owuld be rewriting SchemaGenerator I think its best to consider really is the same as |
Beta Was this translation helpful? Give feedback.
The runtime wiring is used to help create the "runtime aspects" of a schema - eg data fetchers and type resolvers
It is used when you create a schema from a text file, eg from Schema Definition Language (SDL)
https://www.graphql-java.com/documentation/schema#creating-a-schema-using-the-sdl
Nominally the runtime wiring is asked via a call back "do you have a data fetcher" field this field and if so it puts it into the
GraphQLCodeRegistryfor youHowever you can supply in a
GraphQLCodeRegistryto start with and if it has the DF in it for that field than it will use it