-
Notifications
You must be signed in to change notification settings - Fork 305
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
Improve how Querydsl and Query by Example auto registration fits in the hierarchy of DataFetcher registrations #244
Comments
What is Keep in mind, we expect |
Maybe I haven't make things clear. default Details in code sample, and I think change like that will avoid this error: private boolean hasDataFetcher(
GraphQLCodeRegistry.Builder registry, GraphQLFieldsContainer parent,
GraphQLFieldDefinition fieldDefinition) {
DataFetcher<?> defaultDataFetcher = registry.getDefaultDataFetcherFactory().get(null);
DataFetcher<?> fieldFetcher = registry.getDataFetcher(parent, fieldDefinition);
return (fieldFetcher != null && !(defaultDataFetcher.getClass().isInstance(fieldFetcher)));
} |
Thanks for clarifying. We've already run into some challenges with the way auto-registration works, related to extended validation (see #240). I'm going to experiment with replacing the |
CombinedWiringFactory makes use of multiple WiringFactory instances possible, but RuntimeWiring.Builder does not use it by default. This change enables use of multiple WiringFactory instances through an extra callback on RuntimeWiringConfigurer that allows multiple parties to add their own WiringFactory. See gh-244
This ended up a little different, in two changes. The first enables the ability to add any number of Note that we'll need a small follow-up change in the Boot starter before this works out of the box. So if you want to try it, please hold off until the Boot change is in place. I'll update here. |
@dugenkui03 the changes in the Boot starter are now also ready, if you'd like to give it a try with 1.0.0-SNAPSHOT and Boot 2.7.0-SNAPSHOT for the starter. |
Thanks, the bad logic is still exist in |
I think the goal of
AutoRegistrationTypeVisitor#hasDataFetcher
is that: determine whether the field bind customized DataFetcher, instead of default DataFetcher.spring-graphql/spring-graphql/src/main/java/org/springframework/graphql/data/query/AutoRegistrationTypeVisitor.java
Line 104 in a15fd29
But user can change the default DataFetcher of GraphQL Java by
GraphQLCodeRegistry#defaultDataFetcherFactory
. It will be more accurate to replace PropertyDataFetcher to DefaultDataFetcher.The text was updated successfully, but these errors were encountered: