Reputation: 8332
I followed the first part of this tutorial (until code snippet 4) on GraphQL and serverless.
After deploying the serverless application to AWS I query GraphQL using curl, as shown in snippet 4 of the tutorial and get a response as expected:
$ curl -G 'https://example.execute-api.us-east-1.amazonaws.com/dev/query' --data-urlencode 'query={greeting(firstName: "Jeremy")}'
{"data":{"greeting":"Hello, Jeremy."}}
My problem is that when I attempt to make the same query with either Insomnia or Postman, I get 403 error
.
What am I doing wrong? Thank you.
In Insomnia:
Upvotes: 1
Views: 1846
Reputation: 419
To query from Insomnia:
Have an empty body
In the query tab, add a query
property with your GraphQL query
In the Header tab, add a x-api-key
property with your api key
Upvotes: 0
Reputation: 8332
I solved the problem.
While I never got Insomnia to work, I got Postman working.
Turns out that while the configuration in the Postman screenshot I included is correct, I simply forgot that I still had content in the body of the request, which caused the error.
So: Make sure that no query is included in Body if you want to make a GET request
Upvotes: 1