Conversation
…ring-is-performed-after-schema-is-built
… as each element is built
bbakerman
commented
Oct 29, 2020
| * @throws graphql.AssertException if there is not field in context at the time of the directive wiring callback | ||
| */ | ||
| GraphQLFieldDefinition setFieldDataFetcher(DataFetcher newDataFetcher); | ||
| GraphQLFieldDefinition setFieldDataFetcher(DataFetcher<?> newDataFetcher); |
Member
Author
There was a problem hiding this comment.
prevent IDEA warnings on generics
bbakerman
commented
Oct 29, 2020
| if (isIntrospectionType(node)) { | ||
| return true; | ||
| } | ||
| NamedNode<?> definition = suitableFunc.apply(node); |
Member
Author
There was a problem hiding this comment.
the schema directive wiring code makes an assumption we have a SDL AST definition behind it - so it's SDL only
Member
There was a problem hiding this comment.
do we need to restrict it? Is it bad that we restrict it?
Member
Author
There was a problem hiding this comment.
We don't want any one tweaking introspection types I think
bbakerman
commented
Oct 29, 2020
|
|
||
| // they may have changed the arguments to the fieldDefinition so reflect that | ||
| fieldDefinition = fieldDefinition.transform(builder -> builder.clearArguments().arguments(newArgs)); | ||
| if (isNotTheSameObjects(startingArgs, newArgs)) { |
Member
Author
There was a problem hiding this comment.
I changed this so that IF the node did not change, we just return the old node - slight optimisation in tree building
andimarek
deleted the
schema-directive-wiring-is-performed-after-schema-is-built
branch
May 4, 2021 21:06
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.
This is related to the bug #2070
Previously the SchemaDirectiveWiring was called as each element was built. HOwever with type references this meant the callers did not get a full schema
This moves the directive wiring to a post processor and hence it can invoke them after we have a fill schema yet still change them