-
-
Notifications
You must be signed in to change notification settings - Fork 140
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
format_error should return locations as a list of {"line", "column"} #62
format_error should return locations as a list of {"line", "column"} #62
Conversation
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.
Thank you for sending the PR.
Maybe we should add an __eq__
method to SourceLocation that would also allow comparison with a dict (similar to the __eq__
method of GraphQLError). And while being at it, we could also add a custom @property formatted(): return dict(line=self.line, column=self.column)
to SourceLocation that would return an ordinary dict and could be used in format_error
.
codecov doesn't like the |
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.
codecov doesn't like the
SourceLocation.__ne__
method being untested. Should I add explicit tests for__eq__
and__ne__
?
Thtat should do no harm :)
a5f09da
to
de0b14f
Compare
Thank you! |
Fix for #61. This way a simple json.dumps() of format_error(...) should generate correct locations.
I've left
GraphQLError.__eq__
as is, but maybe it should compare dicts to self.formatted?