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

unable to pass request headers to client.rawRequest

Open timojokinen opened this issue 4 years ago • 2 comments

The docs state that both client.request and client.rawRequest can be supplied with a headers object as third parameter. I'm using typescript and I have version 3.3.0 installed and both methods do not accept a third parameter.

client.rawRequest(query, variables, headers); // Expected 1-2 arguments, but got 3.
client.request(query, variables, headers); // Expected 1-2 arguments, but got 3.

timojokinen avatar Dec 12 '20 17:12 timojokinen

@timojokinen I had the same issue, to solve it I runned npm add graphql-request graphql.

ezzahraoui avatar Jan 20 '21 11:01 ezzahraoui

AFAIK this feature is released with 3.4.0. #33

Se example passing-custom-header-per-request

However, using { request, gql } directly instead of { GraphQLClient } is not implemented.

markodvornik avatar Feb 05 '21 13:02 markodvornik