-
Notifications
You must be signed in to change notification settings - Fork 181
Add extensions support to GraphQLError #214
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
Conversation
@syrusakbary can we get this pulled in? This is a big blocker on our ability to pass error code metadata to the client with graphql-python. |
To add some more context for this PR. This is enabling the optional capability of the GraphQL spec that allows generic Map data to be included in the https://graphql.github.io/graphql-spec/June2018/#sec-Errors
My company is currently using this to pass error codes to the client as well as field level validation. Because the {
errors: [{
extensions: {
error: {
error_code: "MyErrorCode",
error_fields: [{path: "name", error: "Custom field error message"}],
support_id: "1234-1234"
}
}
}]
} This PR makes defining the extensions data as a simple kwarg off of the |
@@ -40,6 +42,7 @@ def __init__( | |||
self._positions = positions | |||
self._locations = locations | |||
self.path = path | |||
self.extensions = extensions | |||
return None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This return None
seems unnecessary.
Any idea why it's here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My guess would be for the typings check. It was there prior to this PR though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Ok approving. |
No description provided.