Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upremoved ExecutionContext from DataFetcherEnvironment #1387
Conversation
…in execution context that makes sense to pass on
|
@bbakerman We currently use the |
|
@cmonty thanks for your feedback: can you give use more details how you use it? Also just to be clear: the Thanks |
|
@andimarek Ah, you're correct. We use We do use |
Come 12.0 this will be removed and we will ask you to return a DataFetcherResult wrapper object from your data fetchers This exists today and it can contain data (or null) and errors (or empty list) and the graphql engine will put the errors in the result for you today. So if you move to that system before adopting 12.0 then you will continue to work as expected |
|
Awesome, thanks for the information! |
|
Hi, I have a question about this. We are trying to update our GraphQL code where we also use ExecutionContext.addError(). In the DataFetcherExceptionHandler implementation we want to catch a few specific exceptions and log them as warnings rather than errors. It looks like we can still do that but the return for DataFetcherExceptionHandlerResult requires GraphQL errors. Is there something I can use to convert the regular throwables to GraphQL errors. |
|
@Salrandin - seae the answer above The allows you to send back errors from a data fetcher without throwing an exception. |
|
I kinda get the solution but does this mean every datafetcher has its own responsibility for handling specific errors? The reason the implementation worked well was because we could handle it for all the datafetchers which kept our graphql instance uniform. |
|
You can write your own `graphql.execution.DataFetcherExceptionHandler` if
you want the one handler to be used for all cases
…On Tue, 8 Oct 2019 at 05:06, Salrandin ***@***.***> wrote:
I kinda get the solution but does this mean every datafetcher has its own
responsibility for handling specific errors? The reason the implementation
worked well was because we could handle it for all the datafetchers which
kept our graphql instance uniform.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#1387?email_source=notifications&email_token=AAMVWSNU2CBOCYOYSPPY3RTQNN3CXA5CNFSM4GPUBDIKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEARIY7Q#issuecomment-539135102>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAMVWSOEFEM2QBWQJE4TX5DQNN3CXANCNFSM4GPUBDIA>
.
|
This removes the ExecutionContext from the DataFetcher interface.
This removes the large implementation leak that is in the API.