Skip to content
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

CoercionError does not allow for extra options #1621

Closed
aschepis opened this issue Jun 26, 2018 · 4 comments
Closed

CoercionError does not allow for extra options #1621

aschepis opened this issue Jun 26, 2018 · 4 comments

Comments

@aschepis
Copy link

I have been using the options accessor on GraphQL::ExecutionError to add additional information to errors so that they are consumable by humans and machines. I was also hoping to do this in the case of GraphQL::CoercionErrors that occur during validation but the CoercionError does not allow for this. Is there a specific reason why? If not I would be happy to put together a PR.

@rmosolgo
Copy link
Owner

No, I think it's an oversight! That would be nice improvement, feel free to ping me in the PR if I can help out while it's in progress.

@aschepis
Copy link
Author

@rmosolgo -- do you prefer having a common class that ExecutionError and CoercionError derive from that has the options accessor or just adding an options accessor to CoercionError?

@rmosolgo
Copy link
Owner

Either way is fine with me!

aschepis added a commit to aschepis/graphql-ruby that referenced this issue Jun 28, 2018
This change adds an `extensions` attribute to `CoercionError` in order
to make it consistent with the [GraphQL
Specification](http://facebook.github.io/graphql/June2018/#example-fce18)

Fixes rmosolgo#1621
@rmosolgo
Copy link
Owner

Fixed by #2431

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants