Skip to content

Module is incompatible with graphql==3.2.0 #85

Closed

Description

@thomascobb

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.

Activity

  1. Cito commented on Jan 17, 2022

    @Cito
    Member

    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).

  2. Cito commented on Jan 17, 2022

    @Cito
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions