@graphql-mesh/config 6.1.0 → 6.2.0-alpha-20220823115334-66b1c9be5
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.
- package/index.js +3 -11
- package/index.mjs +4 -12
- package/package.json +8 -8
- package/utils.d.ts +2 -2
package/index.js
CHANGED
|
@@ -10,8 +10,6 @@ const load = require('@graphql-tools/load');
|
|
|
10
10
|
const graphqlFileLoader = require('@graphql-tools/graphql-file-loader');
|
|
11
11
|
const utils$1 = require('@graphql-mesh/utils');
|
|
12
12
|
const codeFileLoader = require('@graphql-tools/code-file-loader');
|
|
13
|
-
const fetch = require('@whatwg-node/fetch');
|
|
14
|
-
const fetchache = require('fetchache');
|
|
15
13
|
const store = require('@graphql-mesh/store');
|
|
16
14
|
const pascalCase = require('pascal-case');
|
|
17
15
|
const camelCase = require('camel-case');
|
|
@@ -69,17 +67,11 @@ async function resolveAdditionalTypeDefs(baseDir, additionalTypeDefs) {
|
|
|
69
67
|
async function resolveCustomFetch({ fetchConfig, importFn, cwd, cache, additionalPackagePrefixes, }) {
|
|
70
68
|
let importCode = '';
|
|
71
69
|
if (!fetchConfig) {
|
|
72
|
-
importCode += `import {
|
|
73
|
-
importCode += `import { fetch, Request, Response } from '@whatwg-node/fetch';\n`;
|
|
70
|
+
importCode += `import { createDefaultMeshFetch } from '@graphql-mesh/utils';\n`;
|
|
74
71
|
return {
|
|
75
|
-
fetchFn:
|
|
76
|
-
cache,
|
|
77
|
-
fetch: fetch.fetch,
|
|
78
|
-
Request: fetch.Request,
|
|
79
|
-
Response: fetch.Response,
|
|
80
|
-
}),
|
|
72
|
+
fetchFn: utils$1.createDefaultMeshFetch(cache),
|
|
81
73
|
importCode,
|
|
82
|
-
code: `const fetchFn =
|
|
74
|
+
code: `const fetchFn = createDefaultMeshFetch(cache);`,
|
|
83
75
|
};
|
|
84
76
|
}
|
|
85
77
|
const { moduleName, resolved: fetchFn } = await getPackage({
|
package/index.mjs
CHANGED
|
@@ -4,10 +4,8 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils';
|
|
|
4
4
|
import { paramCase } from 'param-case';
|
|
5
5
|
import { loadTypedefs, loadDocuments } from '@graphql-tools/load';
|
|
6
6
|
import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
|
7
|
-
import { parseWithCache, PubSub, DefaultLogger, resolveAdditionalResolvers, defaultImportFn } from '@graphql-mesh/utils';
|
|
7
|
+
import { parseWithCache, createDefaultMeshFetch, PubSub, DefaultLogger, resolveAdditionalResolvers, defaultImportFn } from '@graphql-mesh/utils';
|
|
8
8
|
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
|
9
|
-
import { fetch, Request, Response } from '@whatwg-node/fetch';
|
|
10
|
-
import { fetchFactory } from 'fetchache';
|
|
11
9
|
import { MeshStore, FsStoreStorageAdapter, InMemoryStoreStorageAdapter } from '@graphql-mesh/store';
|
|
12
10
|
import { pascalCase } from 'pascal-case';
|
|
13
11
|
import { camelCase } from 'camel-case';
|
|
@@ -65,17 +63,11 @@ async function resolveAdditionalTypeDefs(baseDir, additionalTypeDefs) {
|
|
|
65
63
|
async function resolveCustomFetch({ fetchConfig, importFn, cwd, cache, additionalPackagePrefixes, }) {
|
|
66
64
|
let importCode = '';
|
|
67
65
|
if (!fetchConfig) {
|
|
68
|
-
importCode += `import {
|
|
69
|
-
importCode += `import { fetch, Request, Response } from '@whatwg-node/fetch';\n`;
|
|
66
|
+
importCode += `import { createDefaultMeshFetch } from '@graphql-mesh/utils';\n`;
|
|
70
67
|
return {
|
|
71
|
-
fetchFn:
|
|
72
|
-
cache,
|
|
73
|
-
fetch,
|
|
74
|
-
Request,
|
|
75
|
-
Response,
|
|
76
|
-
}),
|
|
68
|
+
fetchFn: createDefaultMeshFetch(cache),
|
|
77
69
|
importCode,
|
|
78
|
-
code: `const fetchFn =
|
|
70
|
+
code: `const fetchFn = createDefaultMeshFetch(cache);`,
|
|
79
71
|
};
|
|
80
72
|
}
|
|
81
73
|
const { moduleName, resolved: fetchFn } = await getPackage({
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-mesh/config",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0-alpha-20220823115334-66b1c9be5",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@graphql-mesh/runtime": "
|
|
6
|
+
"@graphql-mesh/runtime": "0.42.3-alpha-20220823115334-66b1c9be5",
|
|
7
7
|
"graphql": "*"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@envelop/core": "2.5.0",
|
|
11
|
-
"@graphql-mesh/cache-localforage": "0.6.
|
|
11
|
+
"@graphql-mesh/cache-localforage": "0.6.29-alpha-20220823115334-66b1c9be5",
|
|
12
12
|
"@graphql-mesh/cross-helpers": "0.2.2",
|
|
13
|
-
"@graphql-mesh/merger-bare": "0.15.
|
|
14
|
-
"@graphql-mesh/merger-stitching": "0.16.
|
|
15
|
-
"@graphql-mesh/store": "0.8.
|
|
16
|
-
"@graphql-mesh/types": "0.80.
|
|
17
|
-
"@graphql-mesh/utils": "0.
|
|
13
|
+
"@graphql-mesh/merger-bare": "0.15.13-alpha-20220823115334-66b1c9be5",
|
|
14
|
+
"@graphql-mesh/merger-stitching": "0.16.12-alpha-20220823115334-66b1c9be5",
|
|
15
|
+
"@graphql-mesh/store": "0.8.32-alpha-20220823115334-66b1c9be5",
|
|
16
|
+
"@graphql-mesh/types": "0.80.2-alpha-20220823115334-66b1c9be5",
|
|
17
|
+
"@graphql-mesh/utils": "0.40.0-alpha-20220823115334-66b1c9be5",
|
|
18
18
|
"@graphql-tools/code-file-loader": "7.3.3",
|
|
19
19
|
"@graphql-tools/graphql-file-loader": "7.5.2",
|
|
20
20
|
"@graphql-tools/load": "7.7.4",
|
package/utils.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KeyValueCache, YamlConfig, ImportFn, MeshPubSub, Logger } from '@graphql-mesh/types';
|
|
2
2
|
import { Source } from '@graphql-tools/utils';
|
|
3
|
+
import { MeshFetch } from '@graphql-mesh/utils';
|
|
3
4
|
import { MeshStore } from '@graphql-mesh/store';
|
|
4
|
-
import { fetchFactory } from 'fetchache';
|
|
5
5
|
declare type ResolvedPackage<T> = {
|
|
6
6
|
moduleName: string;
|
|
7
7
|
resolved: T;
|
|
@@ -22,7 +22,7 @@ export declare function resolveCustomFetch({ fetchConfig, importFn, cwd, cache,
|
|
|
22
22
|
additionalPackagePrefixes: string[];
|
|
23
23
|
cache: KeyValueCache;
|
|
24
24
|
}): Promise<{
|
|
25
|
-
fetchFn:
|
|
25
|
+
fetchFn: MeshFetch;
|
|
26
26
|
importCode: string;
|
|
27
27
|
code: string;
|
|
28
28
|
}>;
|