-
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
Getting error but error message contains the actual data I am looking for #388
Comments
Are you using SvelteKit by any chance? We ran into the same issue, but it's actually related to SvelteKit. Their The following code fixes it btw. // hooks.server.js
export async function handle({ event, resolve }) {
return await resolve(event, {
filterSerializedResponseHeaders: name => name === 'content-type'
});
} |
Hi @bummzack , I am not using SvelteKit as far as I know but will check it out. |
Ok, maybe your graphQL Server doesn't sent the proper |
The weird thing is that with POSTMAN this does seem to work, so when running the same query in POSTMAN gives me the restul I would need and when running this with graphlql-request I get this weird effect that the data I want is in the error field as string. So the result is in the response but the response is wrong. |
I suggest you check if the response from your graphql-endpoint contains the proper |
I am getting the same problem, my graphql-endpoint returns "application/graphql+json". Any suggestions? |
Hi @MeloHenrique , I have not been able to fix it for now. |
I think this issue is also related to #373 |
@tverstraete Had the same issue using the default server from graphql-mesh. If you're using graphql-yoga (via graphql-mesh), send a header |
…plication/graphql-response+json content type
When using the following code:
const query = gql
query tenantContexts {
tenantContexts(cloudIds: ["${cloudId}"]) {
cloudId
hostName
}
}
`;
const {tenantContexts} = await request('https://api.atlassian.com/graphql', query).then((data) => console.log(data));
// tenantContexts contains cloudId and hostName
`
I get an error 200 but the error contains my data and no real error message:
{ "response": { "error": "{\"data\":{\"tenantContexts\":[{\"cloudId\":\"xxxx\",\"hostName\":\yyy\"}]},\"extensions\":{\"gateway\":{\"request_id\":\"zzz\",\"crossRegion\":false,\"edgeCrossRegion\":false,\"deprecatedFieldsUsed\":[]}}}", "status": 200, "headers": {} }, "request" : { "query": "\n query hostNameForCloudId {\n tenantContexts(cloudIds: [\"xxxx"]) {\n cloudId\n hostNam e\n }\n }\n " } }
Is there something I am missing or doing wrong?
Thanks.
The text was updated successfully, but these errors were encountered: