How to get ExecutionContext in current version? #2956
-
In previous versions dataFetchingEnvironment.getExecutionContext was available. This was useful when you wanted to insert a GraphqlError into the result but still return some data. I'm curious about how to gain access to the ExecutionContext in the current version, or to be able insert an error and still return results. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
use https://www.graphql-java.com/documentation/execution#returning-data-and-errors |
Beta Was this translation helpful? Give feedback.
-
That seems promising. I wish spring-graphql docs were searchable to see if they support that (I'm guessing yes). Thanks! |
Beta Was this translation helpful? Give feedback.
use
graphql.execution.DataFetcherResult
- this allows you to return data, errors and also local context.https://www.graphql-java.com/documentation/execution#returning-data-and-errors