-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This introduces a Traversal Options to allow skipping the coercing of field arguments #3651
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
Conversation
#3648 was the driver for this change |
@@ -50,13 +51,20 @@ public class NodeVisitorWithTypeTracking extends NodeVisitorStub { | |||
private final GraphQLSchema schema; | |||
private final Map<String, FragmentDefinition> fragmentsByName; | |||
private final ConditionalNodes conditionalNodes = new ConditionalNodes(); | |||
|
|||
public NodeVisitorWithTypeTracking(QueryVisitor preOrderCallback, QueryVisitor postOrderCallback, Map<String, Object> variables, GraphQLSchema schema, Map<String, FragmentDefinition> fragmentsByName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is public but marked as @internal
Locale.getDefault()); | ||
} else { | ||
argumentValues = Collections.emptyMap(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
main change
private final GraphQLCompositeType rootParentType; | ||
private final QueryTraversalOptions options; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QueryTransformer also uses the NodeTracking code and hence this can apply here as well - why not
|
||
Map<Class<?>, Object> rootVars = new LinkedHashMap<>(); | ||
rootVars.put(QueryTraversalContext.class, new QueryTraversalContext(rootParentType, null, null, GraphQLContext.getDefault())); | ||
|
||
TraverserVisitor<Node> nodeTraverserVisitor = new TraverserVisitor<Node>() { | ||
TraverserVisitor<Node> nodeTraverserVisitor = new TraverserVisitor<>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tiny fix up - not need for generic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
The default is the old behaviour of coercing by default
But this can turned off via options
I used an options class so we can extend with further options in the future.