Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

express - Graphql post body "Must provide query string."

I use Express-graphql middleware. I send the following request in the body line:

POST /graphql HTTP/1.1
Host: local:8083
Content-Type: application/graphql
Cache-Control: no-cache
Postman-Token: d71a7ea9-5502-d5fe-2e36-0ae49c635a29

{
   testing {
      pass(id: 1) {
        idn
      }
    }
}

and have error

{
  "errors": [
    {
      "message": "Must provide query string."
    }
  ]
}

in graphql i can send update in URL.

URL string is too short. i must send update model like

mutation {
  update(id: 2, x1: "zazaza", x2: "zazaza", x3: "zazaza" ...(more more fields)...) {
    idn
  }
}

i think its must be in request body. How can i send 'update' query or that i'm doing wrong?

question from:https://stackoverflow.com/questions/36691554/graphql-post-body-must-provide-query-string

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...