Sebastian
Sebastian

Reputation: 442

Having issues with Django-Graphene

enter image description herei built my own content management system here: https://github.com/bastianhilton/Alternate-CMS and I have added graphql support recently with Django-Graphene and updated my models, schema.py. However as I try to run a query, i'm getting the below message. Any direction would be greatly appreciated.

{
  "errors": [
    {
      "message": "relation \"shop_addresscountry\" does not exist\nLINE 1: ... \"shop_addresscountry\".\"is_shipping_country\" FROM \"shop_addr...\n                                                             ^\n"
    }
  ],
  "data": {
    "allAddresscountry": null
  }
}

Upvotes: 1

Views: 455

Answers (1)

AviKKi
AviKKi

Reputation: 1214

relation \"shop_addresscountry\" does not exist This is a database error, that your database does not have the tables, normally these commands will fix it.

python manage.py makemigrations

python manage.py migrate

But you should also move your application logic to another app, i.e. views and models. To create a new app simply use code

python manage.py startapp <app_name>

app_name like products, orders, customers etc. may be applicable for you.

also refer this article if you are new to django.

Upvotes: 1

Related Questions