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

Broken with graphql_relay >= 3.1.1 due to wrong imports

oleo65 opened this issue · comments

  • What is the current behavior?

graphql_relay introduced some internal changes to module names which are not compatible with graphene-django.

This is mainly due to renaming of modules and graphene-django not importing from the to level module but deeper in the package. The Readme of graphql_relay states that everything should be imported from the top module if possible.

The current beta branch is therefore not working anymore.

  1. Install graphene-django (tested with 3.0.0b7) into django with current dependencies (namely graphql-relay > 3.1.1)
  2. Run django.
  3. App crashes during import of fields.py
  • Proposed change

Change imports in fields.py from graphql-relay to top level module. All needed methods are available there.

from graphql_relay import (
    connection_from_array_slice,
    cursor_to_offset,
    get_offset_with_default,
    offset_to_cursor,
)
  • Please tell us about your environment:

    • Version: v3.0.0b7
    • Platform: linux x64
commented

I believe this is already fixed on the main branch. We are just awaiting a formal release.

Thanks, I literally just noticed that. Well I should have searched better. 😉