You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting the default data fetcher with the last call will work, but I believe this isn't a good solution since this is a builder pattern and there's already a null check for setting the enumValuesProvider, and typeResolver.
Moreover in my case using it with spring-graphql, Spring's RuntimeWiringConfigurer will first let you set your custom DataFetchers and then add all the annotated data fetchers, not the other way around.
Why is that you calling a TypeRuntimeWiring.Builder so many times? Is this trying to show that multiple steps might continue to add more config into an existing type?
Concerning your question, you're absolutely right.
The RuntimeWiring.Builder is used by multiple beans in spring-graphql (through the RuntimeWiringConfigurer), each bean call type(). I wanted to convey that idea in my example.
I wouldn't do repeated calls to type() in the same method
Describe the bug
Successive calls to RuntimeWiring.Builder::type will overwrite the defaultDataFetchers value with null if the defaultDataFetcher isn't present.
Setting the default data fetcher with the last call will work, but I believe this isn't a good solution since this is a builder pattern and there's already a null check for setting the enumValuesProvider, and typeResolver.
Moreover in my case using it with spring-graphql, Spring's RuntimeWiringConfigurer will first let you set your custom DataFetchers and then add all the annotated data fetchers, not the other way around.
Proposed solution
Inside
graphql.schema.idl.RuntimeWiring.class, RuntimeWiring.Builder::type(TypeRuntimeWiring typeRuntimeWiring)
Replace :
With : (Just like the typeResolver and enumValuesProvider right after that)
The text was updated successfully, but these errors were encountered: