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

Add Is(err error) bool to gqlerror to work with errors.Is #249

Open
RobAtticus opened this issue Dec 14, 2022 · 2 comments
Open

Add Is(err error) bool to gqlerror to work with errors.Is #249

RobAtticus opened this issue Dec 14, 2022 · 2 comments

Comments

@RobAtticus
Copy link

What happened?

Trying to compare two gqlerrors using either errors.Is or something like https://github.com/google/go-cmp with cmpopts.EquateErrors fails when the two errors have all the same fields, but are different structs.

What did you expect?

The comparison to succeed. Because gqlerror does not implement an Is method, it fails even though they are for all intents and purposes equal.

versions

  • go list -m github.com/vektah/gqlparser/v2? v2.5.1
  • go version? v1.19.4
@StevenACoffman
Copy link
Collaborator

Excellent idea! PR welcome!

@RobAtticus
Copy link
Author

I'm not sure I have enough context on each of the fields to say what equal should be. Hopefully someone with more confidence can step in.

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