I am using the Insomnia client to form GraphQL Queries.
I have the following Query
query purchaseOrders{purchaseOrders(limit: 1){poNumber}}
Sending with the Bearer Token as the only header.
I'm getting a 400 response, this is the first time I've worked with GraphQL, so I'm not sure what I'm doing wrong or how to troubleshoot.
This Query works in my sandbox.
Turns out the API isn't in production yet.
Related
I am trying to call a Postman GET endpoint, and it is returning HTML and status 200, instead of a valid JSON response and status 200. It looks like it is not hitting the backend at all. I have a separate POST endpoint, which works fine and returns me a valid JSON response.
Could this be due to authorization headers? I am using the same authorization for both.
I managed to resolve the issue. I had to add a cookie header, which I got from the browser since I was able to call the service from the browser and I had authenticated on browser level.
For 3 Days, my project which worked perfectly locally, once put on the production server.
GraphQl requests are a failure with the error "[Error: Network error: JSON Parse error: Unrecognized token '<']" and after log analysis it is a 404 error because the route was not found.
After investigation via the GraphQl Atlair client for chrome by changing the method to GET to make my GrasphQl requests, the error everything works.
my question is how to work the POST method?
I really need to use the METHOD POST for mutations
Thanks everyone
Very cordially
You forgot to add a trailing slash to your GraphQL endpoint URL.
Related issue (solved): https://github.com/overblog/GraphQLBundle/issues/669
I'm not able to figure out why the REST API call works just fine in Postman but not in the GraphQL Playground. If I could see the actual REST call being made by GraphQL, would be helpful to debug the issue.
Firecamp's GraphQL client lets you test the GraphQL as an API call or as a Query way.
Here is the dedicated GraphQL client
Here is REST like GraphQL client
Note: Make sure that you double-check the method and headers while using REST-like GraphQL client. IN most cases method would be post and header should contains Content-Type: application-json / application/graphql
The GraphQL playground allows to send GraphQL queries/mutations to your GraphQL server. You can see the requests that are send using the network tab of a browser dev tools.
For example, if a server is in running at the following address http://localhost:4000/graphql, sending a query/mutation, a XHR request will be sent to it. In the Request Payload of the Headers section there is the query/mutation itself.
In the Response section you can see the returned response.
You can start having a look at the returned response of your query/mutation. Perhaps there is something wrong in the related resolve function in GraphQL.
I'd like to get a list of my documents from google docs api. First I get a authValue using ClientLogin, then I send a request to that url https://docs.google.com/feeds/documents/private/full with header set to "Authorization: GoogleLogin auth=authValue", but I always get a response "Authorization required". What should I do?
Make sure you request the token with the "writely" service when performing ClientLogin. Also, make sure that you're sending the token provided after Auth= in the ClientLogin response.
Authorization: GoogleLogin auth=DQAAA...
Trying to generate API documentation via laravel-apidoc-generator, and get the following error:
I tried to use actAsUserId and header options and got the same error.
I have the same problem, and still have, but you can try to send authorization token via headers, and if that doesn't work, try to send the token as Query String Parameter. Neither of those work for me...