graphql-request icon indicating copy to clipboard operation
graphql-request copied to clipboard

How can get the headers on response ?

Open cesarbuenrostro-tiempodev opened this issue 7 years ago • 4 comments

I was playing with dist/src/index.js

Why return response.data instead response? i'm trying to get the headers on the response, but when return response.data, i can't access to headers methods u.u.

maybe in the future?

Would be useful as an optional info whenever GraphQL Errors are thrown.

berstend avatar Jan 31 '19 10:01 berstend

My headers are always empty. I can see the headers in Chromes network tab.

dbousamra avatar Jul 08 '21 06:07 dbousamra

PR welcome

jasonkuhrt avatar Jul 09 '21 02:07 jasonkuhrt

Turns out it was the server missing a CORS header.

dbousamra avatar Jul 09 '21 23:07 dbousamra