You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SourceLocation, as a NamedTuple, is serialized by json.dumps() to an array instead of an object. Graphql.js keeps SourceLocation as and object, so it just works for them.
Reproduction:
fromgraphqlimportSourceLocation, GraphQLError, format_error, Sourceimportjsonprint(json.dumps(format_error(GraphQLError(message="test", source=Source('{ test }'), positions=[2]))))
Good point. Yes, I think it makes totally sense to return locations as a list of dicts in format_error - that's why we have this function. Feel free to send a PR, or otherwise I can change this.
Activity
Fix GraphQLView tests, skip some of them
Fix GraphQLView tests, skip some of them
Cito commentedon Sep 16, 2019
Good point. Yes, I think it makes totally sense to return locations as a list of dicts in
format_error- that's why we have this function. Feel free to send a PR, or otherwise I can change this.Cito commentedon Sep 26, 2019
This is now included in v3.0.0b1.