Graphene Django “Must provide query string”

后端 未结 7 650
醉酒成梦
醉酒成梦 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:28

    Checkout sample apps and see how they do things,

    e.g. https://github.com/mjtamlyn/graphene-tutorial they do the following:

    from django.views.decorators.csrf import csrf_exempt
    from graphene_django.views import GraphQLView
    
    url(r'^explore', GraphQLView.as_view(graphiql=True)),
    url(r'^graphql', csrf_exempt(GraphQLView.as_view())),
    

提交回复
热议问题