@graphql-mesh/transport-rest 0.8.13 → 0.8.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -224,10 +224,7 @@ function addHTTPRootFieldResolver(schema, field, globalLogger = new utils_1.Defa
|
|
|
224
224
|
fullPath += `fields=${(0, jsonApiFields_js_1.getJsonApiFieldsQuery)(info)}`;
|
|
225
225
|
}
|
|
226
226
|
operationLogger.debug(`=> Fetching `, fullPath, `=>`, requestInit);
|
|
227
|
-
const fetch = context?.fetch || globalFetch;
|
|
228
|
-
if (!fetch) {
|
|
229
|
-
return new TypeError(`You should have fetch defined in either the config or the context!`);
|
|
230
|
-
}
|
|
227
|
+
const fetch = context?.fetch || globalFetch || fetch_1.fetch;
|
|
231
228
|
// Trick to pass `sourceName` to the `fetch` function for tracing
|
|
232
229
|
const response = await fetch(fullPath, requestInit, context, {
|
|
233
230
|
...info,
|
|
@@ -6,7 +6,7 @@ import { process } from '@graphql-mesh/cross-helpers';
|
|
|
6
6
|
import { stringInterpolator } from '@graphql-mesh/string-interpolation';
|
|
7
7
|
import { DefaultLogger, getHeadersObj } from '@graphql-mesh/utils';
|
|
8
8
|
import { createGraphQLError, memoize1 } from '@graphql-tools/utils';
|
|
9
|
-
import { Blob, File, FormData, URLSearchParams } from '@whatwg-node/fetch';
|
|
9
|
+
import { Blob, fetch as defaultFetch, File, FormData, URLSearchParams } from '@whatwg-node/fetch';
|
|
10
10
|
import { isFileUpload } from './isFileUpload.js';
|
|
11
11
|
import { getJsonApiFieldsQuery } from './jsonApiFields.js';
|
|
12
12
|
import { resolveDataByUnionInputType } from './resolveDataByUnionInputType.js';
|
|
@@ -220,10 +220,7 @@ export function addHTTPRootFieldResolver(schema, field, globalLogger = new Defau
|
|
|
220
220
|
fullPath += `fields=${getJsonApiFieldsQuery(info)}`;
|
|
221
221
|
}
|
|
222
222
|
operationLogger.debug(`=> Fetching `, fullPath, `=>`, requestInit);
|
|
223
|
-
const fetch = context?.fetch || globalFetch;
|
|
224
|
-
if (!fetch) {
|
|
225
|
-
return new TypeError(`You should have fetch defined in either the config or the context!`);
|
|
226
|
-
}
|
|
223
|
+
const fetch = context?.fetch || globalFetch || defaultFetch;
|
|
227
224
|
// Trick to pass `sourceName` to the `fetch` function for tracing
|
|
228
225
|
const response = await fetch(fullPath, requestInit, context, {
|
|
229
226
|
...info,
|