SchemaGeneratorHelper that does NOT put in an entry for defaulted values#3755
Merged
bbakerman merged 4 commits intosingeton_property_data_fetcherfrom Nov 26, 2024
Merged
Conversation
…Helper that does NOT put in an entry for defaulted values
…Helper that does NOT put in an entry for defaulted values- DFF tweaked
bbakerman
commented
Nov 25, 2024
|
|
||
| default DataFetcher<T> getViaField(GraphQLFieldDefinition fieldDefinition) { | ||
| return null; | ||
| } |
Member
Author
There was a problem hiding this comment.
DataFetcherFactoryEnvironment is a "parameter" object that ONLYT wraps a GraphQLFieldDefinition
It was put in place for "future expansion reasons" but we never expanded it and never had to. So this one as a bad bet since we have to make a new object just to pass 1 object we already have
This method undoes that and says we can lookup via just the GraphQLFieldDefinition object
bbakerman
commented
Nov 25, 2024
| // if the dataFetcherFactory is empty, then it must have been the code registry default one | ||
| // and hence we don't need to make a "map entry" in the code registry since it will be defaulted | ||
| // anyway | ||
| dataFetcherFactory.ifPresent(fetcherFactory -> buildCtx.getCodeRegistry().dataFetcher(coordinates, fetcherFactory)); |
Member
Author
There was a problem hiding this comment.
This is the saving - we are not holding a DF per field when it would be defaulted in the code registry.
If we had 90% DFs that are the default - eg PropertyDataFetchers - then we save all those entries in memory
…efault # Conflicts: # src/main/java/graphql/schema/PropertyDataFetcher.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the code registry DFF value is the default then there is no need for a map entry since the lookup will default to the default