@@ -11,7 +11,6 @@ import { resolveRequestDocument } from './resolveRequestDocument.js'
1111import type {
1212 BatchRequestDocument ,
1313 FetchOptions ,
14- GraphQLClientRequestHeaders ,
1514 GraphQLClientResponse ,
1615 HTTPMethodInput ,
1716 JsonSerializer ,
@@ -37,7 +36,7 @@ import type { TypedDocumentNode } from '@graphql-typed-document-node/core'
3736/**
3837 * Convert the given headers configuration into a plain object.
3938 */
40- const resolveHeaders = ( headers ?: GraphQLClientRequestHeaders ) : Record < string , string > => {
39+ const resolveHeaders = ( headers ?: HeadersInit ) : Record < string , string > => {
4140 let oHeaders : Record < string , string > = { }
4241 if ( headers ) {
4342 if ( headers instanceof Headers ) {
@@ -124,7 +123,7 @@ interface RequestVerbParams<V extends Variables = Variables> {
124123 fetch : Fetch
125124 fetchOptions : FetchOptions
126125 variables ?: V
127- headers ?: GraphQLClientRequestHeaders
126+ headers ?: HeadersInit
128127 operationName ?: string
129128 middleware ?: RequestMiddleware < V >
130129}
@@ -297,11 +296,11 @@ class GraphQLClient {
297296 * Send GraphQL documents in batch to the server.
298297 */
299298 // prettier-ignore
300- batchRequests < T extends BatchResult , V extends Variables = Variables > ( documents : BatchRequestDocument < V > [ ] , requestHeaders ?: GraphQLClientRequestHeaders ) : Promise < T >
299+ batchRequests < T extends BatchResult , V extends Variables = Variables > ( documents : BatchRequestDocument < V > [ ] , requestHeaders ?: HeadersInit ) : Promise < T >
301300 // prettier-ignore
302301 batchRequests < T extends BatchResult , V extends Variables = Variables > ( options : BatchRequestsOptions < V > ) : Promise < T >
303302 // prettier-ignore
304- batchRequests < T extends BatchResult , V extends Variables = Variables > ( documentsOrOptions : BatchRequestDocument < V > [ ] | BatchRequestsOptions < V > , requestHeaders ?: GraphQLClientRequestHeaders ) : Promise < T > {
303+ batchRequests < T extends BatchResult , V extends Variables = Variables > ( documentsOrOptions : BatchRequestDocument < V > [ ] | BatchRequestsOptions < V > , requestHeaders ?: HeadersInit ) : Promise < T > {
305304 const batchRequestOptions = parseBatchRequestArgs < V > ( documentsOrOptions , requestHeaders )
306305 const { headers, ...fetchOptions } = this . requestConfig
307306
@@ -343,7 +342,7 @@ class GraphQLClient {
343342 } )
344343 }
345344
346- setHeaders ( headers : GraphQLClientRequestHeaders ) : GraphQLClient {
345+ setHeaders ( headers : HeadersInit ) : GraphQLClient {
347346 this . requestConfig . headers = headers
348347 return this
349348 }
@@ -378,7 +377,7 @@ const makeRequest = async <T = unknown, V extends Variables = Variables>(params:
378377 url : string
379378 query : string | string [ ]
380379 variables ?: V
381- headers ?: GraphQLClientRequestHeaders
380+ headers ?: HeadersInit
382381 operationName ?: string
383382 fetch : Fetch
384383 method ?: HTTPMethodInput
@@ -431,13 +430,13 @@ const makeRequest = async <T = unknown, V extends Variables = Variables>(params:
431430
432431// prettier-ignore
433432interface RawRequestMethod {
434- < T , V extends Variables = Variables > ( query : string , variables ?: V , requestHeaders ?: GraphQLClientRequestHeaders ) : Promise < GraphQLClientResponse < T > >
433+ < T , V extends Variables = Variables > ( query : string , variables ?: V , requestHeaders ?: HeadersInit ) : Promise < GraphQLClientResponse < T > >
435434 < T , V extends Variables = Variables > ( options : RawRequestOptions < V > ) : Promise < GraphQLClientResponse < T > >
436435}
437436
438437// prettier-ignore
439438type RawRequestMethodArgs < V extends Variables > =
440- | [ query : string , variables ?: V , requestHeaders ?: GraphQLClientRequestHeaders ]
439+ | [ query : string , variables ?: V , requestHeaders ?: HeadersInit ]
441440 | [ RawRequestOptions < V > ]
442441
443442// prettier-ignore
@@ -563,12 +562,12 @@ type BatchResult = [Result, ...Result[]]
563562
564563// prettier-ignore
565564interface BatchRequests {
566- < T extends BatchResult , V extends Variables = Variables > ( url : string , documents : BatchRequestDocument < V > [ ] , requestHeaders ?: GraphQLClientRequestHeaders ) : Promise < T >
565+ < T extends BatchResult , V extends Variables = Variables > ( url : string , documents : BatchRequestDocument < V > [ ] , requestHeaders ?: HeadersInit ) : Promise < T >
567566 < T extends BatchResult , V extends Variables = Variables > ( options : BatchRequestsExtendedOptions < V > ) : Promise < T >
568567}
569568
570569type BatchRequestsArgs =
571- | [ url : string , documents : BatchRequestDocument [ ] , requestHeaders ?: GraphQLClientRequestHeaders ]
570+ | [ url : string , documents : BatchRequestDocument [ ] , requestHeaders ?: HeadersInit ]
572571 | [ options : BatchRequestsExtendedOptions ]
573572
574573const parseBatchRequestsArgsExtended = ( args : BatchRequestsArgs ) : BatchRequestsExtendedOptions => {
@@ -674,7 +673,6 @@ export {
674673 BatchRequestsOptions ,
675674 ClientError ,
676675 GraphQLClient ,
677- GraphQLClientRequestHeaders ,
678676 rawRequest ,
679677 RawRequestExtendedOptions ,
680678 RawRequestOptions ,
0 commit comments