Skip to content

How do I pass metadata from Parent resolver to child resolvers? #3597

Answered by dondonz
govi20 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, you're right that the GraphQLContext inside the ExecutionContext is global.

In plain GraphQL Java we've got a separate context concept called local context, have a look for getLocalContext inside DataFetchingEnvironment. This will pass on context from parent to child fields, and this context is not available globally.

I say "plain GraphQL Java" because things are slightly different if you use Spring for GraphQL, but I didn't want to go ahead too far in case local context is what you're after.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by govi20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants