Search code examples
pythondjangographqlgraphene-django

Unresolved reference 'graphene_django'


I just started working with GraphQL, Django and Graphene.

I was attempting to import GraphQLView and DjangoObjectType from graphene_django

but it always says

unresolved reference

I did already installed the needed modules with pip install graphene-django==2.8.2, and the Virtual environment is up and running.

#settings.py
INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'books',
    'graphene_django',
]

I couldn't get graphene_django to import properly. What are the possible fixes to this?


Solution

  • To solve the issue:

    1. navigate to your preferences (settings)
    2. go to 'Project'
    3. python interpreter
    4. click add on the packages list
    5. in the package manager search for graphene_django
    6. install -> apply

    and you should be good to go.

    enter image description here