-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graphql Error 200 #140
Comments
Same here! Trying to use TheGraph's API. It has the content-type header correctly set to |
@nicosampler @jjant I hit this issue too, adding It seems like here: https://github.com/prisma/graphql-request/blob/master/src/index.ts#L119-L126 |
Add a |
Thanks @jc4p we too had the same issue. Adding the header value "Accept: application/json" resolved the issue. Note :- Adding the "Content-Type: application/json" to the header didn't help us. On a side note we should be better capturing the parse error or proper content error instead capturing the data inside error block, which confuses us more. |
If you have an endpoint working as a proxy between the client and the graphql server, make sure you return
and not just
|
In my case, the server (Smallrye GraphQL) responds:
Solved by:
|
Hi! I know this spec is a work in progress: https://github.com/graphql/graphql-over-http/blob/main/spec/GraphQLOverHTTP.md#response, but it seems like a good idea to handle responses typed |
I'm facing the same issue while working on file upload, and nothing worked. The weird part is that everything works fine, the file is uploaded to server, and I've checked the JSON returned in the response and it's in the right format! |
This worked for me. We were using nock to test responses and we were missing this in our object!!!! |
save my hours time, thanks @micheljung 🎉 |
Added this to my proxied route's response header worked. |
Looks like the specification now stipulates the following for the
Considering this, and the fact that a next major version is due soon. Perhaps this should be included by default for every request made by |
@jonkoops Yep that would be great! |
Hi I have a graphql server already running where I can run queries through graphiQL.
If I took one of those queries and run it from my nodejs script using this lib, it fails in a strange manner because it throws a 200 error, but the response contains the correct query response.
let me put an example, in graphiQL, if I run this:
it responds with
but using this lib from my script
it responds
The text was updated successfully, but these errors were encountered: