-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Milestone
Description
Describe the bug
I'm trying to use ConditionalNodeDecision but it not invoked for every field, just the top level one.
To Reproduce
final ExecutionInput executionInput = ExecutionInput.newExecutionInput()
.query(request.query())
.operationName(request.operationName())
.variables(request.variables())
.graphQLContext(builder ->
.graphQLContext(builder ->
builder
.put(ConditionalNodeDecision.class, new Custom()) <-- but then in graphql.execution.conditional.ConditionalNodes#shouldInclude:
// if they have declared a decision callback, then we will use it but we expect this to be mostly
// empty and hence the cost is a map lookup.
if (graphQLContext != null) {
ConditionalNodeDecision conditionalDecision = graphQLContext.get(ConditionalNodeDecision.class);only the first call has the context, subsequent calls have empty context.
The first call is originating in:

and as you can see the context is defined.
The next call is originating in getImmediateFields:

and at this point the context is empty.
Graphql-java version is 21.2 on JDK 17.
Metadata
Metadata
Assignees
Labels
No labels