Closed simonw closed 2 years ago
datasette_graphql/__init__.py:4: in <module>
from graphql.error import format_error
E ImportError: cannot import name 'format_error' from 'graphql.error' (/opt/hostedtoolcache/Python/3.7.13/x64/lib/python3.7/site-packages/graphql/error/__init__.py)
Looks like format_error
was deprecated here: https://github.com/graphql-python/graphql-core/commit/09ff14f68bdce1e9cd71decc871fd38274b01971
Found a clue here: https://github.com/graphql-python/graphql-core/blob/7c0d73a24359ac10b5fc46691ba22579f4080ce4/src/graphql/error/graphql_error.py#L259
def format_error(error: GraphQLError) -> GraphQLFormattedError:
"""
...
.. deprecated:: 3.2
Please use ``error.formatted`` instead. Will be removed in v3.3.
"""
if not isinstance(error, GraphQLError):
raise TypeError("Expected a GraphQLError.")
return error.formatted
It was graphql-core
that caused the bug, and upgrading to Graphene 3.1.0 doen't force an upgrade of that package, so I'm pinning to at least that version as well.
I think this is breaking things.