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

Module is incompatible with graphql==3.2.0 #85

Closed
thomascobb opened this issue Jan 17, 2022 · 2 comments
Closed

Module is incompatible with graphql==3.2.0 #85

thomascobb opened this issue Jan 17, 2022 · 2 comments

Comments

@thomascobb
Copy link

On import (for instance when running tests) you get

___________________________________________ ERROR collecting tests/test_helpers.py ___________________________________________
ImportError while importing test module '/home/tom/Programming/graphql-server/tests/test_helpers.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_helpers.py:8: in <module>
    from graphql_server import (
graphql_server/__init__.py:15: in <module>
    from graphql.error import format_error as format_error_default
E   ImportError: cannot import name 'format_error' from 'graphql.error' (/home/tom/Programming/graphql-server/graphql-server-dev/lib/python3.8/site-packages/graphql/error/__init__.py)

It appears that format_error is now only importable from graphql.error.graphql_error and not graphql.error. It also appears to now be deprecated:
graphql-python/graphql-core@09ff14f

Would you like a PR to fix? If so, would you prefer just a change to the import path, or a dependency bump on graphql-core>=3.2.0 and use of the new method?

Also the README for graphl-core recommends using graphql-core~=3.2.0 so I could also change that.

@Cito
Copy link
Member

Cito commented Jan 17, 2022

Yes, pinning the requirement to the minor version (graphql-core~=3.2.0) would be the right thing to do.

format_error was indeed deprecated, you can use the property GraphQLError.formatted now (similar in GraphQL.js).

@Cito
Copy link
Member

Cito commented Jan 17, 2022

I have already fixed this in graphql-server 3.0.0b5,

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