-
Notifications
You must be signed in to change notification settings - Fork 271
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
subgraph errors should bubble up to the next nullable parent field #215
Comments
this should probably be done as part of the |
@cecton ^ |
Looks interesting! |
I'll take this one |
more context on this: currently subgraph errors are not integrated in the response. If we have something obvious like a connection error to the subgraph, it will be present, but if there was an error for a specific entity, we would get from the subgraph a response with an errors array containing some errors and related path, and those are not gathered right now. We need to gather the subgraph errors, append their path to the current query plan node's path, and erase the error message (we don't want to expose subgraph info there).
|
aggregating the errors is easy enough. Recognizing nullable fields will be a bit more challenging: when traversing the response with errors, for each field we will need to look up in the schema if it is nullable |
as described in https://www.apollographql.com/blog/graphql/basics/using-nullability-in-graphql/
With this schema:
if a subgraph returns a response with this content:
location
must not be null, so we register an error, and mark therestaurant
itself as null:spec: https://spec.graphql.org/June2018/#sec-Errors
The text was updated successfully, but these errors were encountered: