Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No headers on error response #245

Closed
emckay opened this issue Jan 11, 2021 · 0 comments · Fixed by #246
Closed

No headers on error response #245

emckay opened this issue Jan 11, 2021 · 0 comments · Fixed by #246

Comments

@emckay
Copy link
Contributor

emckay commented Jan 11, 2021

When the server returns an error response, the response headers are added to the ClientError in rawRequest:

https://github.com/prisma-labs/graphql-request/blob/5b233c5658e65ed0d98cf8bff50beec413f399b9/src/index.ts#L71-L73

However, these headers are not added in request:

https://github.com/prisma-labs/graphql-request/blob/5b233c5658e65ed0d98cf8bff50beec413f399b9/src/index.ts#L104

In my application, I need to respond to errors differently based on the response headers, but I'd prefer not to use rawRequest.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant