Graphene Django “Must provide query string”

后端 未结 7 657
醉酒成梦
醉酒成梦 2021-01-12 06:52

I have setup a Graphene server using Django. When I run my queries through GraphiQL (the web client), everything works fine. However, when I run from anywhere else, I get th

7条回答
  •  北恋
    北恋 (楼主)
    2021-01-12 07:38

    The problem in my code was that I had the URL improperly setup for graphQL. I had the following:

    url(r'^graphql/', GraphQLView.as_view())
    

    The forward slash was a huge difference. Removing it fixed the problem. The proper way to do it would be:

    url(r'^graphql', GraphQLView.as_view())
    

提交回复
热议问题