File tree Expand file tree Collapse file tree 4 files changed +190
-271
lines changed Expand file tree Collapse file tree 4 files changed +190
-271
lines changed Original file line number Diff line number Diff line change @@ -233,6 +233,7 @@ export function createHive(options: HivePluginOptions): HiveClient {
233
233
? createPersistedDocuments ( {
234
234
...options . experimental__persistedDocuments ,
235
235
logger,
236
+ fetch : options . experimental__persistedDocuments . fetch ,
236
237
} )
237
238
: null ,
238
239
} ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ type HeadersObject = {
10
10
export function createPersistedDocuments (
11
11
config : PersistedDocumentsConfiguration & {
12
12
logger : Logger ;
13
+ fetch ?: typeof fetch ;
13
14
} ,
14
15
) : null | {
15
16
resolve ( documentId : string ) : PromiseOrValue < string | null > ;
@@ -51,6 +52,7 @@ export function createPersistedDocuments(
51
52
} ,
52
53
logger : config . logger ,
53
54
isRequestOk : response => response . status === 200 || response . status === 404 ,
55
+ fetchImplementation : config . fetch ,
54
56
} )
55
57
. then ( async response => {
56
58
if ( response . status !== 200 ) {
Original file line number Diff line number Diff line change @@ -304,6 +304,11 @@ export type PersistedDocumentsConfiguration = {
304
304
* @default 10_000
305
305
*/
306
306
cache ?: number ;
307
+ /**
308
+ * WHATWG Compatible fetch implementation
309
+ * used for doing HTTP requests.
310
+ */
311
+ fetch ?: typeof fetch ;
307
312
} ;
308
313
309
314
export type AllowArbitraryDocumentsFunction = ( context : {
You can’t perform that action at this time.
0 commit comments