3

I installed WPGraphQL plugin on my wordpress dashboard but And I tried accessing it via mysite/graphql

I got this error

{"errors":[{"message":"GraphQL Request must include at least one of those two parameters: \"query\" or \"queryId\"","extensions":{"category":"request"}}],"extensions":{"debug":[]}}

What could be the cause?

Adewale Perfect
  • 553
  • 1
  • 5
  • 12

3 Answers3

1

You have to pass an query parameter e-g: http://localhost:8000/graphql?query={user(id:1){email}} and you want graphql-playground then install play-ground package then just access play-ground by this link: http://localhost:8000/graphql-playground

0

As others have stated, you need a query.

When the extension is activated, it serves as any API. It'll give you the data that you request, not direct you to some website. You can access the GraphiQL IDE to get a visual representation of the queries you can make.

brentj
  • 3
  • 3
0

I think something like this is what you may be after:

curl -v -X POST -H 'X-WP-NONCE: 6fd57fe0ac' --cookie 'wordpress_logged_in_37d007a56d816107ce5b52c10342db37=wordpress|1647471410|i2dnczBB8vm2pblmRJWQ0NtuQ1lA7elWpB1TiRhXeMi|9c3dc66b56babcafa294156dc91f65cc6b2c2feb5e784a0380eb6c44141fb5c6' -F 'query={posts{edges{node{id}}}}' 'http://localhost:8080/graphql'

  • 2
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 16 '22 at 00:07