graphql-python / graphql-python/graphene-django

Circular Import: cannot import name 'GraphQLObjectType' from partially initialized module 'graphql.type'

Open
#1,436 2 comments 0 reactions 0 assignees View on GitHub
🐛bug
Dominant language
Python
Stars
4.4k
Forks
760
PR merge metrics
No merged PRs in 30d

Description

**Note: for support questions, please use stackoverflow**. This repository's issues are reserved for feature requests and bug reports.

* **What is the current behavior?**
When running project with `graphene-django` installed I get the following error:

```
File "/ve/lib/python3.8/site-packages/graphene_django/__init__.py", line 1, in
--
1970 | from .fields import DjangoConnectionField, DjangoListField
1971 | File "/ve/lib/python3.8/site-packages/graphene_django/fields.py", line 4, in
1972 | from graphql_relay.connection.arrayconnection import (
1973 | File "/ve/lib/python3.8/site-packages/graphql_relay/connection/arrayconnection.py", line 10, in
1974 | from ..utils.base64 import base64, unbase64
1975 | File "/ve/lib/python3.8/site-packages/graphql_relay/__init__.py", line 16, in
1976 | from .connection.connection import (
1977 | File "/ve/lib/python3.8/site-packages/graphql_relay/connection/connection.py", line 3, in
1978 | from graphql.type import (
1979 | File "/ve/lib/python3.8/site-packages/graphql/type/__init__.py", line 8, in
1980 | from .schema import (
1981 | File "/ve/lib/python3.8/site-packages/graphql/type/schema.py", line 17, in
1982 | from .definition import (
1983 | File "/ve/lib/python3.8/site-packages/graphql/type/definition.py", line 57, in
1984 | from ..utilities.value_from_ast_untyped import value_from_ast_untyped
1985 | File "/ve/lib/python3.8/site-packages/graphql/utilities/__init__.py", line 14, in
1986 | from .get_operation_root_type import get_operation_root_type
1987 | File "/ve/lib/python3.8/site-packages/graphql/utilities/get_operation_root_type.py", line 9, in
1988 | from ..type import GraphQLObjectType, GraphQLSchema
1989 | ImportError: cannot import name 'GraphQLObjectType' from partially initialized module 'graphql.type' (most likely due to a circular import) (/ve/lib/python3.8/site-packages/graphql/type/__init__.py)

```

* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** via
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).

* **What is the expected behavior?**

Project starting without errors.

* **Please tell us about your environment:**

- Version:

graphene: 3.0b7
graphene-django: 3.0.0b7
graphql-core: 3.1.5
graphql-relay: 3.1.0

- Platform: Linux

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.