graphql-python / graphene-django

Build powerful, efficient, and flexible GraphQL APIs with seamless Django integration.

Home Page:http://docs.graphene-python.org/projects/django/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not compatible with graphql-core 3.2

ukch opened this issue · comments

  • What is the current behavior?
    According to graphql-python/graphql-server#85, graphql-core minor versions can have breaking changes. I recently upgraded my dependencies, and now see this issue:
$ ./manage.py check
Traceback (most recent call last):
  File "...", line 22, in <module>
    main()
  File "...", line 18, in main
    execute_from_command_line(sys.argv)
  File ".../lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File ".../lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File ".../lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File ".../lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute
    output = self.handle(*args, **options)
  File ".../lib/python3.9/site-packages/django/core/management/commands/check.py", line 76, in handle
    self.check(
  File ".../lib/python3.9/site-packages/django/core/management/base.py", line 475, in check
    all_issues = checks.run_checks(
  File ".../lib/python3.9/site-packages/django/core/checks/registry.py", line 88, in run_checks
    new_errors = check(app_configs=app_configs, databases=databases)
  File ".../lib/python3.9/site-packages/django/core/checks/urls.py", line 14, in check_url_config
    return check_resolver(resolver)
  File ".../lib/python3.9/site-packages/django/core/checks/urls.py", line 24, in check_resolver
    return check_method()
  File ".../lib/python3.9/site-packages/django/urls/resolvers.py", line 476, in check
    for pattern in self.url_patterns:
  File ".../lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File ".../lib/python3.9/site-packages/django/urls/resolvers.py", line 690, in url_patterns
    patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
  File ".../lib/python3.9/site-packages/django/utils/functional.py", line 57, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File ".../lib/python3.9/site-packages/django/urls/resolvers.py", line 683, in urlconf_module
    return import_module(self.urlconf_name)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File ".../urls.py", line 20, in <module>
    [redacted]
  File ".../views.py", line 8, in <module>
    from graphene_django.views import GraphQLView
  File ".../lib/python3.9/site-packages/graphene_django/views.py", line 14, in <module>
    from graphql.error import format_error as format_graphql_error
ImportError: cannot import name 'format_error' from 'graphql.error' (.../lib/python3.9/site-packages/graphql/error/__init__.py)
  • Please tell us about your environment:

    • Version: 3.0.0b7
    • graphql-core version: 3.2.1
    • Platform: Linux with Python 3.9
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

The suggested fix in the other issue was to pin the version of graphql-core to <3.2

Fixed in #1327