@graphql-codegen/typescript-react-query 3.5.15 → 3.5.16-alpha-2ada7b533.0
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/cjs/config.js +2 -0
- package/cjs/fetcher-custom-mapper.js +108 -0
- package/cjs/fetcher-fetch-hardcoded.js +108 -0
- package/cjs/fetcher-fetch.js +96 -0
- package/cjs/fetcher-graphql-request.js +92 -0
- package/cjs/fetcher.js +2 -0
- package/cjs/index.js +39 -0
- package/cjs/package.json +1 -0
- package/cjs/variables-generator.js +37 -0
- package/cjs/visitor.js +143 -0
- package/esm/config.js +1 -0
- package/esm/fetcher-custom-mapper.js +104 -0
- package/esm/fetcher-fetch-hardcoded.js +104 -0
- package/esm/fetcher-fetch.js +92 -0
- package/esm/fetcher-graphql-request.js +88 -0
- package/esm/fetcher.js +1 -0
- package/esm/index.js +34 -0
- package/esm/variables-generator.js +27 -0
- package/esm/visitor.js +138 -0
- package/package.json +22 -15
- package/{config.d.ts → typings/config.d.ts} +0 -0
- package/{fetcher-custom-mapper.d.ts → typings/fetcher-custom-mapper.d.ts} +3 -3
- package/{fetcher-fetch-hardcoded.d.ts → typings/fetcher-fetch-hardcoded.d.ts} +3 -3
- package/{fetcher-fetch.d.ts → typings/fetcher-fetch.d.ts} +2 -2
- package/{fetcher-graphql-request.d.ts → typings/fetcher-graphql-request.d.ts} +2 -2
- package/{fetcher.d.ts → typings/fetcher.d.ts} +0 -0
- package/{index.d.ts → typings/index.d.ts} +2 -2
- package/{variables-generator.d.ts → typings/variables-generator.d.ts} +0 -0
- package/{visitor.d.ts → typings/visitor.d.ts} +2 -2
- package/index.js +0 -592
- package/index.mjs +0 -584
package/cjs/config.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomMapperFetcher = void 0;
|
|
4
|
+
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
5
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
6
|
+
class CustomMapperFetcher {
|
|
7
|
+
constructor(visitor, customFetcher) {
|
|
8
|
+
this.visitor = visitor;
|
|
9
|
+
if (typeof customFetcher === 'string') {
|
|
10
|
+
customFetcher = { func: customFetcher };
|
|
11
|
+
}
|
|
12
|
+
this._mapper = (0, visitor_plugin_common_1.parseMapper)(customFetcher.func);
|
|
13
|
+
this._isReactHook = customFetcher.isReactHook;
|
|
14
|
+
}
|
|
15
|
+
getFetcherFnName(operationResultType, operationVariablesTypes) {
|
|
16
|
+
return `${this._mapper.type}<${operationResultType}, ${operationVariablesTypes}>`;
|
|
17
|
+
}
|
|
18
|
+
generateFetcherImplementaion() {
|
|
19
|
+
if (this._mapper.isExternal) {
|
|
20
|
+
return (0, visitor_plugin_common_1.buildMapperImport)(this._mapper.source, [
|
|
21
|
+
{
|
|
22
|
+
identifier: this._mapper.type,
|
|
23
|
+
asDefault: this._mapper.default,
|
|
24
|
+
},
|
|
25
|
+
], this.visitor.config.useTypeImports);
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
30
|
+
const variables = `variables${hasRequiredVariables ? '' : '?'}: ${operationVariablesTypes}`;
|
|
31
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
32
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.infiniteQuery.hook);
|
|
33
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
34
|
+
const options = `options?: ${hookConfig.infiniteQuery.options}<${operationResultType}, TError, TData>`;
|
|
35
|
+
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
36
|
+
const implHookOuter = this._isReactHook ? `const query = ${typedFetcher}(${documentVariableName})` : '';
|
|
37
|
+
const impl = this._isReactHook
|
|
38
|
+
? `(metaData) => query({...variables, ...(metaData.pageParam ?? {})})`
|
|
39
|
+
: `(metaData) => ${typedFetcher}(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})()`;
|
|
40
|
+
return `export const useInfinite${operationName} = <
|
|
41
|
+
TData = ${operationResultType},
|
|
42
|
+
TError = ${this.visitor.config.errorType}
|
|
43
|
+
>(
|
|
44
|
+
${variables},
|
|
45
|
+
${options}
|
|
46
|
+
) =>{
|
|
47
|
+
${implHookOuter}
|
|
48
|
+
return ${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
49
|
+
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
50
|
+
${impl},
|
|
51
|
+
options
|
|
52
|
+
)};`;
|
|
53
|
+
}
|
|
54
|
+
generateQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
55
|
+
const variables = `variables${hasRequiredVariables ? '' : '?'}: ${operationVariablesTypes}`;
|
|
56
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
57
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.query.hook);
|
|
58
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.query.options);
|
|
59
|
+
const options = `options?: ${hookConfig.query.options}<${operationResultType}, TError, TData>`;
|
|
60
|
+
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
61
|
+
const impl = this._isReactHook
|
|
62
|
+
? `${typedFetcher}(${documentVariableName}).bind(null, variables)`
|
|
63
|
+
: `${typedFetcher}(${documentVariableName}, variables)`;
|
|
64
|
+
return `export const use${operationName} = <
|
|
65
|
+
TData = ${operationResultType},
|
|
66
|
+
TError = ${this.visitor.config.errorType}
|
|
67
|
+
>(
|
|
68
|
+
${variables},
|
|
69
|
+
${options}
|
|
70
|
+
) =>
|
|
71
|
+
${hookConfig.query.hook}<${operationResultType}, TError, TData>(
|
|
72
|
+
${(0, variables_generator_js_1.generateQueryKey)(node, hasRequiredVariables)},
|
|
73
|
+
${impl},
|
|
74
|
+
options
|
|
75
|
+
);`;
|
|
76
|
+
}
|
|
77
|
+
generateMutationHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
78
|
+
const variables = `variables?: ${operationVariablesTypes}`;
|
|
79
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
80
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.mutation.hook);
|
|
81
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.mutation.options);
|
|
82
|
+
const options = `options?: ${hookConfig.mutation.options}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>`;
|
|
83
|
+
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
84
|
+
const impl = this._isReactHook
|
|
85
|
+
? `${typedFetcher}(${documentVariableName})`
|
|
86
|
+
: `(${variables}) => ${typedFetcher}(${documentVariableName}, variables)()`;
|
|
87
|
+
return `export const use${operationName} = <
|
|
88
|
+
TError = ${this.visitor.config.errorType},
|
|
89
|
+
TContext = unknown
|
|
90
|
+
>(${options}) =>
|
|
91
|
+
${hookConfig.mutation.hook}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>(
|
|
92
|
+
${(0, variables_generator_js_1.generateMutationKey)(node)},
|
|
93
|
+
${impl},
|
|
94
|
+
options
|
|
95
|
+
);`;
|
|
96
|
+
}
|
|
97
|
+
generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
98
|
+
// We can't generate a fetcher field since we can't call react hooks outside of a React Fucntion Component
|
|
99
|
+
// Related: https://reactjs.org/docs/hooks-rules.html
|
|
100
|
+
if (this._isReactHook)
|
|
101
|
+
return '';
|
|
102
|
+
const variables = `variables${hasRequiredVariables ? '' : '?'}: ${operationVariablesTypes}`;
|
|
103
|
+
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
104
|
+
const impl = `${typedFetcher}(${documentVariableName}, variables, options)`;
|
|
105
|
+
return `\nuse${operationName}.fetcher = (${variables}, options?: RequestInit['headers']) => ${impl};`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.CustomMapperFetcher = CustomMapperFetcher;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HardcodedFetchFetcher = void 0;
|
|
4
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
5
|
+
class HardcodedFetchFetcher {
|
|
6
|
+
constructor(visitor, config) {
|
|
7
|
+
this.visitor = visitor;
|
|
8
|
+
this.config = config;
|
|
9
|
+
}
|
|
10
|
+
getEndpoint() {
|
|
11
|
+
try {
|
|
12
|
+
new URL(this.config.endpoint);
|
|
13
|
+
return JSON.stringify(this.config.endpoint);
|
|
14
|
+
}
|
|
15
|
+
catch (e) {
|
|
16
|
+
return `${this.config.endpoint} as string`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
getFetchParams() {
|
|
20
|
+
let fetchParamsPartial = '';
|
|
21
|
+
if (this.config.fetchParams) {
|
|
22
|
+
const fetchParamsString = typeof this.config.fetchParams === 'string' ? this.config.fetchParams : JSON.stringify(this.config.fetchParams);
|
|
23
|
+
fetchParamsPartial = `\n ...(${fetchParamsString}),`;
|
|
24
|
+
}
|
|
25
|
+
return ` method: "POST",${fetchParamsPartial}`;
|
|
26
|
+
}
|
|
27
|
+
generateFetcherImplementaion() {
|
|
28
|
+
return `
|
|
29
|
+
function fetcher<TData, TVariables>(query: string, variables?: TVariables) {
|
|
30
|
+
return async (): Promise<TData> => {
|
|
31
|
+
const res = await fetch(${this.getEndpoint()}, {
|
|
32
|
+
${this.getFetchParams()}
|
|
33
|
+
body: JSON.stringify({ query, variables }),
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const json = await res.json();
|
|
37
|
+
|
|
38
|
+
if (json.errors) {
|
|
39
|
+
const { message } = json.errors[0];
|
|
40
|
+
|
|
41
|
+
throw new Error(message);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return json.data;
|
|
45
|
+
}
|
|
46
|
+
}`;
|
|
47
|
+
}
|
|
48
|
+
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
49
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
50
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
51
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.infiniteQuery.hook);
|
|
52
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
53
|
+
const options = `options?: ${hookConfig.infiniteQuery.options}<${operationResultType}, TError, TData>`;
|
|
54
|
+
return `export const useInfinite${operationName} = <
|
|
55
|
+
TData = ${operationResultType},
|
|
56
|
+
TError = ${this.visitor.config.errorType}
|
|
57
|
+
>(
|
|
58
|
+
pageParamKey: keyof ${operationVariablesTypes},
|
|
59
|
+
${variables},
|
|
60
|
+
${options}
|
|
61
|
+
) =>
|
|
62
|
+
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
63
|
+
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
64
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
65
|
+
options
|
|
66
|
+
);`;
|
|
67
|
+
}
|
|
68
|
+
generateQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
69
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
70
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
71
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.query.hook);
|
|
72
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.query.options);
|
|
73
|
+
const options = `options?: ${hookConfig.query.options}<${operationResultType}, TError, TData>`;
|
|
74
|
+
return `export const use${operationName} = <
|
|
75
|
+
TData = ${operationResultType},
|
|
76
|
+
TError = ${this.visitor.config.errorType}
|
|
77
|
+
>(
|
|
78
|
+
${variables},
|
|
79
|
+
${options}
|
|
80
|
+
) =>
|
|
81
|
+
${hookConfig.query.hook}<${operationResultType}, TError, TData>(
|
|
82
|
+
${(0, variables_generator_js_1.generateQueryKey)(node, hasRequiredVariables)},
|
|
83
|
+
fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, variables),
|
|
84
|
+
options
|
|
85
|
+
);`;
|
|
86
|
+
}
|
|
87
|
+
generateMutationHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
88
|
+
const variables = `variables?: ${operationVariablesTypes}`;
|
|
89
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
90
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.mutation.hook);
|
|
91
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.mutation.options);
|
|
92
|
+
const options = `options?: ${hookConfig.mutation.options}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>`;
|
|
93
|
+
return `export const use${operationName} = <
|
|
94
|
+
TError = ${this.visitor.config.errorType},
|
|
95
|
+
TContext = unknown
|
|
96
|
+
>(${options}) =>
|
|
97
|
+
${hookConfig.mutation.hook}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>(
|
|
98
|
+
${(0, variables_generator_js_1.generateMutationKey)(node)},
|
|
99
|
+
(${variables}) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, variables)(),
|
|
100
|
+
options
|
|
101
|
+
);`;
|
|
102
|
+
}
|
|
103
|
+
generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
104
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
105
|
+
return `\nuse${operationName}.fetcher = (${variables}) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, variables);`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.HardcodedFetchFetcher = HardcodedFetchFetcher;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FetchFetcher = void 0;
|
|
4
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
5
|
+
class FetchFetcher {
|
|
6
|
+
constructor(visitor) {
|
|
7
|
+
this.visitor = visitor;
|
|
8
|
+
}
|
|
9
|
+
generateFetcherImplementaion() {
|
|
10
|
+
return `
|
|
11
|
+
function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit, query: string, variables?: TVariables) {
|
|
12
|
+
return async (): Promise<TData> => {
|
|
13
|
+
const res = await fetch(endpoint, {
|
|
14
|
+
method: 'POST',
|
|
15
|
+
...requestInit,
|
|
16
|
+
body: JSON.stringify({ query, variables }),
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const json = await res.json();
|
|
20
|
+
|
|
21
|
+
if (json.errors) {
|
|
22
|
+
const { message } = json.errors[0];
|
|
23
|
+
|
|
24
|
+
throw new Error(message);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return json.data;
|
|
28
|
+
}
|
|
29
|
+
}`;
|
|
30
|
+
}
|
|
31
|
+
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
32
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
33
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
34
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.infiniteQuery.hook);
|
|
35
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
36
|
+
const options = `options?: ${hookConfig.query.options}<${operationResultType}, TError, TData>`;
|
|
37
|
+
return `export const useInfinite${operationName} = <
|
|
38
|
+
TData = ${operationResultType},
|
|
39
|
+
TError = ${this.visitor.config.errorType}
|
|
40
|
+
>(
|
|
41
|
+
dataSource: { endpoint: string, fetchParams?: RequestInit },
|
|
42
|
+
pageParamKey: keyof ${operationVariablesTypes},
|
|
43
|
+
${variables},
|
|
44
|
+
${options}
|
|
45
|
+
) =>
|
|
46
|
+
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
47
|
+
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
48
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
49
|
+
options
|
|
50
|
+
);`;
|
|
51
|
+
}
|
|
52
|
+
generateQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
53
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
54
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
55
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.query.hook);
|
|
56
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.query.options);
|
|
57
|
+
const options = `options?: ${hookConfig.query.options}<${operationResultType}, TError, TData>`;
|
|
58
|
+
return `export const use${operationName} = <
|
|
59
|
+
TData = ${operationResultType},
|
|
60
|
+
TError = ${this.visitor.config.errorType}
|
|
61
|
+
>(
|
|
62
|
+
dataSource: { endpoint: string, fetchParams?: RequestInit },
|
|
63
|
+
${variables},
|
|
64
|
+
${options}
|
|
65
|
+
) =>
|
|
66
|
+
${hookConfig.query.hook}<${operationResultType}, TError, TData>(
|
|
67
|
+
${(0, variables_generator_js_1.generateQueryKey)(node, hasRequiredVariables)},
|
|
68
|
+
fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, variables),
|
|
69
|
+
options
|
|
70
|
+
);`;
|
|
71
|
+
}
|
|
72
|
+
generateMutationHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
73
|
+
const variables = `variables?: ${operationVariablesTypes}`;
|
|
74
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
75
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.mutation.hook);
|
|
76
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.mutation.options);
|
|
77
|
+
const options = `options?: ${hookConfig.mutation.options}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>`;
|
|
78
|
+
return `export const use${operationName} = <
|
|
79
|
+
TError = ${this.visitor.config.errorType},
|
|
80
|
+
TContext = unknown
|
|
81
|
+
>(
|
|
82
|
+
dataSource: { endpoint: string, fetchParams?: RequestInit },
|
|
83
|
+
${options}
|
|
84
|
+
) =>
|
|
85
|
+
${hookConfig.mutation.hook}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>(
|
|
86
|
+
${(0, variables_generator_js_1.generateMutationKey)(node)},
|
|
87
|
+
(${variables}) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, variables)(),
|
|
88
|
+
options
|
|
89
|
+
);`;
|
|
90
|
+
}
|
|
91
|
+
generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
92
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
93
|
+
return `\nuse${operationName}.fetcher = (dataSource: { endpoint: string, fetchParams?: RequestInit }, ${variables}) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, variables);`;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.FetchFetcher = FetchFetcher;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphQLRequestClientFetcher = void 0;
|
|
4
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
5
|
+
class GraphQLRequestClientFetcher {
|
|
6
|
+
constructor(visitor) {
|
|
7
|
+
this.visitor = visitor;
|
|
8
|
+
}
|
|
9
|
+
generateFetcherImplementaion() {
|
|
10
|
+
return `
|
|
11
|
+
function fetcher<TData, TVariables>(client: GraphQLClient, query: string, variables?: TVariables, headers?: RequestInit['headers']) {
|
|
12
|
+
return async (): Promise<TData> => client.request<TData, TVariables>(query, variables, headers);
|
|
13
|
+
}`;
|
|
14
|
+
}
|
|
15
|
+
generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
16
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
17
|
+
const typeImport = this.visitor.config.useTypeImports ? 'import type' : 'import';
|
|
18
|
+
this.visitor.imports.add(`${typeImport} { GraphQLClient } from 'graphql-request';`);
|
|
19
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
20
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.infiniteQuery.hook);
|
|
21
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
22
|
+
const options = `options?: ${hookConfig.infiniteQuery.options}<${operationResultType}, TError, TData>`;
|
|
23
|
+
return `export const useInfinite${operationName} = <
|
|
24
|
+
TData = ${operationResultType},
|
|
25
|
+
TError = ${this.visitor.config.errorType}
|
|
26
|
+
>(
|
|
27
|
+
pageParamKey: keyof ${operationVariablesTypes},
|
|
28
|
+
client: GraphQLClient,
|
|
29
|
+
${variables},
|
|
30
|
+
${options},
|
|
31
|
+
headers?: RequestInit['headers']
|
|
32
|
+
) =>
|
|
33
|
+
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
34
|
+
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
35
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})}, headers)(),
|
|
36
|
+
options
|
|
37
|
+
);`;
|
|
38
|
+
}
|
|
39
|
+
generateQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
40
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
41
|
+
const typeImport = this.visitor.config.useTypeImports ? 'import type' : 'import';
|
|
42
|
+
this.visitor.imports.add(`${typeImport} { GraphQLClient } from 'graphql-request';`);
|
|
43
|
+
this.visitor.imports.add(`${typeImport} { RequestInit } from 'graphql-request/dist/types.dom';`);
|
|
44
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
45
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.query.hook);
|
|
46
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.query.options);
|
|
47
|
+
const options = `options?: ${hookConfig.query.options}<${operationResultType}, TError, TData>`;
|
|
48
|
+
return `export const use${operationName} = <
|
|
49
|
+
TData = ${operationResultType},
|
|
50
|
+
TError = ${this.visitor.config.errorType}
|
|
51
|
+
>(
|
|
52
|
+
client: GraphQLClient,
|
|
53
|
+
${variables},
|
|
54
|
+
${options},
|
|
55
|
+
headers?: RequestInit['headers']
|
|
56
|
+
) =>
|
|
57
|
+
${hookConfig.query.hook}<${operationResultType}, TError, TData>(
|
|
58
|
+
${(0, variables_generator_js_1.generateQueryKey)(node, hasRequiredVariables)},
|
|
59
|
+
fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, variables, headers),
|
|
60
|
+
options
|
|
61
|
+
);`;
|
|
62
|
+
}
|
|
63
|
+
generateMutationHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
64
|
+
const variables = `variables?: ${operationVariablesTypes}`;
|
|
65
|
+
const typeImport = this.visitor.config.useTypeImports ? 'import type' : 'import';
|
|
66
|
+
this.visitor.imports.add(`${typeImport} { GraphQLClient } from 'graphql-request';`);
|
|
67
|
+
const hookConfig = this.visitor.queryMethodMap;
|
|
68
|
+
this.visitor.reactQueryHookIdentifiersInUse.add(hookConfig.mutation.hook);
|
|
69
|
+
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.mutation.options);
|
|
70
|
+
const options = `options?: ${hookConfig.mutation.options}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>`;
|
|
71
|
+
return `export const use${operationName} = <
|
|
72
|
+
TError = ${this.visitor.config.errorType},
|
|
73
|
+
TContext = unknown
|
|
74
|
+
>(
|
|
75
|
+
client: GraphQLClient,
|
|
76
|
+
${options},
|
|
77
|
+
headers?: RequestInit['headers']
|
|
78
|
+
) =>
|
|
79
|
+
${hookConfig.mutation.hook}<${operationResultType}, TError, ${operationVariablesTypes}, TContext>(
|
|
80
|
+
${(0, variables_generator_js_1.generateMutationKey)(node)},
|
|
81
|
+
(${variables}) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, variables, headers)(),
|
|
82
|
+
options
|
|
83
|
+
);`;
|
|
84
|
+
}
|
|
85
|
+
generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
86
|
+
const variables = (0, variables_generator_js_1.generateQueryVariablesSignature)(hasRequiredVariables, operationVariablesTypes);
|
|
87
|
+
const typeImport = this.visitor.config.useTypeImports ? 'import type' : 'import';
|
|
88
|
+
this.visitor.imports.add(`${typeImport} { RequestInit } from 'graphql-request/dist/types.dom';`);
|
|
89
|
+
return `\nuse${operationName}.fetcher = (client: GraphQLClient, ${variables}, headers?: RequestInit['headers']) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, variables, headers);`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.GraphQLRequestClientFetcher = GraphQLRequestClientFetcher;
|
package/cjs/fetcher.js
ADDED
package/cjs/index.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactQueryVisitor = exports.validate = exports.plugin = void 0;
|
|
4
|
+
const graphql_1 = require("graphql");
|
|
5
|
+
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
6
|
+
const visitor_js_1 = require("./visitor.js");
|
|
7
|
+
Object.defineProperty(exports, "ReactQueryVisitor", { enumerable: true, get: function () { return visitor_js_1.ReactQueryVisitor; } });
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const plugin = (schema, documents, config) => {
|
|
10
|
+
const allAst = (0, graphql_1.concatAST)(documents.map(v => v.document));
|
|
11
|
+
const allFragments = [
|
|
12
|
+
...allAst.definitions.filter(d => d.kind === graphql_1.Kind.FRAGMENT_DEFINITION).map(fragmentDef => ({
|
|
13
|
+
node: fragmentDef,
|
|
14
|
+
name: fragmentDef.name.value,
|
|
15
|
+
onType: fragmentDef.typeCondition.name.value,
|
|
16
|
+
isExternal: false,
|
|
17
|
+
})),
|
|
18
|
+
...(config.externalFragments || []),
|
|
19
|
+
];
|
|
20
|
+
const visitor = new visitor_js_1.ReactQueryVisitor(schema, allFragments, config, documents);
|
|
21
|
+
const visitorResult = (0, plugin_helpers_1.oldVisit)(allAst, { leave: visitor });
|
|
22
|
+
if (visitor.hasOperations) {
|
|
23
|
+
return {
|
|
24
|
+
prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
|
|
25
|
+
content: [visitor.fragments, ...visitorResult.definitions.filter(t => typeof t === 'string')].join('\n'),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
prepend: [...visitor.getImports()],
|
|
30
|
+
content: [visitor.fragments, ...visitorResult.definitions.filter(t => typeof t === 'string')].join('\n'),
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
exports.plugin = plugin;
|
|
34
|
+
const validate = async (schema, documents, config, outputFile) => {
|
|
35
|
+
if ((0, path_1.extname)(outputFile) !== '.ts' && (0, path_1.extname)(outputFile) !== '.tsx') {
|
|
36
|
+
throw new Error(`Plugin "typescript-react-query" requires extension to be ".ts" or ".tsx"!`);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.validate = validate;
|
package/cjs/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateMutationKeyMaker = exports.generateMutationKey = exports.generateQueryKeyMaker = exports.generateQueryKey = exports.generateInfiniteQueryKeyMaker = exports.generateInfiniteQueryKey = exports.generateQueryVariablesSignature = void 0;
|
|
4
|
+
function generateQueryVariablesSignature(hasRequiredVariables, operationVariablesTypes) {
|
|
5
|
+
return `variables${hasRequiredVariables ? '' : '?'}: ${operationVariablesTypes}`;
|
|
6
|
+
}
|
|
7
|
+
exports.generateQueryVariablesSignature = generateQueryVariablesSignature;
|
|
8
|
+
function generateInfiniteQueryKey(node, hasRequiredVariables) {
|
|
9
|
+
if (hasRequiredVariables)
|
|
10
|
+
return `['${node.name.value}.infinite', variables]`;
|
|
11
|
+
return `variables === undefined ? ['${node.name.value}.infinite'] : ['${node.name.value}.infinite', variables]`;
|
|
12
|
+
}
|
|
13
|
+
exports.generateInfiniteQueryKey = generateInfiniteQueryKey;
|
|
14
|
+
function generateInfiniteQueryKeyMaker(node, operationName, operationVariablesTypes, hasRequiredVariables) {
|
|
15
|
+
const signature = generateQueryVariablesSignature(hasRequiredVariables, operationVariablesTypes);
|
|
16
|
+
return `\nuseInfinite${operationName}.getKey = (${signature}) => ${generateInfiniteQueryKey(node, hasRequiredVariables)};\n`;
|
|
17
|
+
}
|
|
18
|
+
exports.generateInfiniteQueryKeyMaker = generateInfiniteQueryKeyMaker;
|
|
19
|
+
function generateQueryKey(node, hasRequiredVariables) {
|
|
20
|
+
if (hasRequiredVariables)
|
|
21
|
+
return `['${node.name.value}', variables]`;
|
|
22
|
+
return `variables === undefined ? ['${node.name.value}'] : ['${node.name.value}', variables]`;
|
|
23
|
+
}
|
|
24
|
+
exports.generateQueryKey = generateQueryKey;
|
|
25
|
+
function generateQueryKeyMaker(node, operationName, operationVariablesTypes, hasRequiredVariables) {
|
|
26
|
+
const signature = generateQueryVariablesSignature(hasRequiredVariables, operationVariablesTypes);
|
|
27
|
+
return `\nuse${operationName}.getKey = (${signature}) => ${generateQueryKey(node, hasRequiredVariables)};\n`;
|
|
28
|
+
}
|
|
29
|
+
exports.generateQueryKeyMaker = generateQueryKeyMaker;
|
|
30
|
+
function generateMutationKey(node) {
|
|
31
|
+
return `['${node.name.value}']`;
|
|
32
|
+
}
|
|
33
|
+
exports.generateMutationKey = generateMutationKey;
|
|
34
|
+
function generateMutationKeyMaker(node, operationName) {
|
|
35
|
+
return `\nuse${operationName}.getKey = () => ${generateMutationKey(node)};\n`;
|
|
36
|
+
}
|
|
37
|
+
exports.generateMutationKeyMaker = generateMutationKeyMaker;
|
package/cjs/visitor.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactQueryVisitor = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
6
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
7
|
+
const fetcher_custom_mapper_js_1 = require("./fetcher-custom-mapper.js");
|
|
8
|
+
const fetcher_fetch_js_1 = require("./fetcher-fetch.js");
|
|
9
|
+
const fetcher_graphql_request_js_1 = require("./fetcher-graphql-request.js");
|
|
10
|
+
const fetcher_fetch_hardcoded_js_1 = require("./fetcher-fetch-hardcoded.js");
|
|
11
|
+
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
12
|
+
const change_case_all_1 = require("change-case-all");
|
|
13
|
+
class ReactQueryVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
|
|
14
|
+
constructor(schema, fragments, rawConfig, documents) {
|
|
15
|
+
super(schema, fragments, rawConfig, {
|
|
16
|
+
documentMode: visitor_plugin_common_1.DocumentMode.string,
|
|
17
|
+
errorType: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.errorType, 'unknown'),
|
|
18
|
+
exposeDocument: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeDocument, false),
|
|
19
|
+
exposeQueryKeys: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeQueryKeys, false),
|
|
20
|
+
exposeMutationKeys: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeMutationKeys, false),
|
|
21
|
+
exposeFetcher: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.exposeFetcher, false),
|
|
22
|
+
addInfiniteQuery: (0, visitor_plugin_common_1.getConfigValue)(rawConfig.addInfiniteQuery, false),
|
|
23
|
+
});
|
|
24
|
+
this.rawConfig = rawConfig;
|
|
25
|
+
this.reactQueryHookIdentifiersInUse = new Set();
|
|
26
|
+
this.reactQueryOptionsIdentifiersInUse = new Set();
|
|
27
|
+
this.queryMethodMap = {
|
|
28
|
+
infiniteQuery: {
|
|
29
|
+
hook: 'useInfiniteQuery',
|
|
30
|
+
options: 'UseInfiniteQueryOptions',
|
|
31
|
+
},
|
|
32
|
+
query: {
|
|
33
|
+
hook: 'useQuery',
|
|
34
|
+
options: 'UseQueryOptions',
|
|
35
|
+
},
|
|
36
|
+
mutation: {
|
|
37
|
+
hook: 'useMutation',
|
|
38
|
+
options: 'UseMutationOptions',
|
|
39
|
+
},
|
|
40
|
+
};
|
|
41
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom ? `${this.config.importOperationTypesFrom}.` : '';
|
|
42
|
+
this._documents = documents;
|
|
43
|
+
this.fetcher = this.createFetcher(rawConfig.fetcher || 'fetch');
|
|
44
|
+
(0, auto_bind_1.default)(this);
|
|
45
|
+
}
|
|
46
|
+
get imports() {
|
|
47
|
+
return this._imports;
|
|
48
|
+
}
|
|
49
|
+
createFetcher(raw) {
|
|
50
|
+
if (raw === 'fetch') {
|
|
51
|
+
return new fetcher_fetch_js_1.FetchFetcher(this);
|
|
52
|
+
}
|
|
53
|
+
if (typeof raw === 'object' && 'endpoint' in raw) {
|
|
54
|
+
return new fetcher_fetch_hardcoded_js_1.HardcodedFetchFetcher(this, raw);
|
|
55
|
+
}
|
|
56
|
+
if (raw === 'graphql-request') {
|
|
57
|
+
return new fetcher_graphql_request_js_1.GraphQLRequestClientFetcher(this);
|
|
58
|
+
}
|
|
59
|
+
return new fetcher_custom_mapper_js_1.CustomMapperFetcher(this, raw);
|
|
60
|
+
}
|
|
61
|
+
get hasOperations() {
|
|
62
|
+
return this._collectedOperations.length > 0;
|
|
63
|
+
}
|
|
64
|
+
getImports() {
|
|
65
|
+
const baseImports = super.getImports();
|
|
66
|
+
if (!this.hasOperations) {
|
|
67
|
+
return baseImports;
|
|
68
|
+
}
|
|
69
|
+
if (this.config.addInfiniteQuery) {
|
|
70
|
+
this.reactQueryOptionsIdentifiersInUse.add('QueryFunctionContext');
|
|
71
|
+
}
|
|
72
|
+
const hookAndTypeImports = [
|
|
73
|
+
...Array.from(this.reactQueryHookIdentifiersInUse),
|
|
74
|
+
...Array.from(this.reactQueryOptionsIdentifiersInUse).map(identifier => `${this.config.useTypeImports ? 'type ' : ''}${identifier}`),
|
|
75
|
+
];
|
|
76
|
+
return [...baseImports, `import { ${hookAndTypeImports.join(', ')} } from 'react-query';`];
|
|
77
|
+
}
|
|
78
|
+
getFetcherImplementation() {
|
|
79
|
+
return this.fetcher.generateFetcherImplementaion();
|
|
80
|
+
}
|
|
81
|
+
_getHookSuffix(name, operationType) {
|
|
82
|
+
if (this.config.omitOperationSuffix) {
|
|
83
|
+
return '';
|
|
84
|
+
}
|
|
85
|
+
if (!this.config.dedupeOperationSuffix) {
|
|
86
|
+
return (0, change_case_all_1.pascalCase)(operationType);
|
|
87
|
+
}
|
|
88
|
+
if (name.includes('Query') || name.includes('Mutation') || name.includes('Subscription')) {
|
|
89
|
+
return '';
|
|
90
|
+
}
|
|
91
|
+
return (0, change_case_all_1.pascalCase)(operationType);
|
|
92
|
+
}
|
|
93
|
+
buildOperation(node, documentVariableName, operationType, operationResultType, operationVariablesTypes, hasRequiredVariables) {
|
|
94
|
+
var _a, _b;
|
|
95
|
+
const nodeName = (_b = (_a = node.name) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
96
|
+
const suffix = this._getHookSuffix(nodeName, operationType);
|
|
97
|
+
const operationName = this.convertName(nodeName, {
|
|
98
|
+
suffix,
|
|
99
|
+
useTypesPrefix: false,
|
|
100
|
+
useTypesSuffix: false,
|
|
101
|
+
});
|
|
102
|
+
operationResultType = this._externalImportPrefix + operationResultType;
|
|
103
|
+
operationVariablesTypes = this._externalImportPrefix + operationVariablesTypes;
|
|
104
|
+
if (operationType === 'Query') {
|
|
105
|
+
let query = this.fetcher.generateQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables);
|
|
106
|
+
if (this.config.exposeDocument) {
|
|
107
|
+
query += `\nuse${operationName}.document = ${documentVariableName};\n`;
|
|
108
|
+
}
|
|
109
|
+
if (this.config.exposeQueryKeys) {
|
|
110
|
+
query += `\n${(0, variables_generator_js_1.generateQueryKeyMaker)(node, operationName, operationVariablesTypes, hasRequiredVariables)};\n`;
|
|
111
|
+
}
|
|
112
|
+
if (this.config.addInfiniteQuery) {
|
|
113
|
+
query += `\n${this.fetcher.generateInfiniteQueryHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables)}\n`;
|
|
114
|
+
if (this.config.exposeQueryKeys) {
|
|
115
|
+
query += `\n${(0, variables_generator_js_1.generateInfiniteQueryKeyMaker)(node, operationName, operationVariablesTypes, hasRequiredVariables)};\n`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// The reason we're looking at the private field of the CustomMapperFetcher to see if it's a react hook
|
|
119
|
+
// is to prevent calling generateFetcherFetch for each query since all the queries won't be able to generate
|
|
120
|
+
// a fetcher field anyways.
|
|
121
|
+
if (this.config.exposeFetcher && !this.fetcher._isReactHook) {
|
|
122
|
+
query += this.fetcher.generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables);
|
|
123
|
+
}
|
|
124
|
+
return query;
|
|
125
|
+
}
|
|
126
|
+
if (operationType === 'Mutation') {
|
|
127
|
+
let query = this.fetcher.generateMutationHook(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables);
|
|
128
|
+
if (this.config.exposeMutationKeys) {
|
|
129
|
+
query += (0, variables_generator_js_1.generateMutationKeyMaker)(node, operationName);
|
|
130
|
+
}
|
|
131
|
+
if (this.config.exposeFetcher && !this.fetcher._isReactHook) {
|
|
132
|
+
query += this.fetcher.generateFetcherFetch(node, documentVariableName, operationName, operationResultType, operationVariablesTypes, hasRequiredVariables);
|
|
133
|
+
}
|
|
134
|
+
return query;
|
|
135
|
+
}
|
|
136
|
+
if (operationType === 'Subscription') {
|
|
137
|
+
// eslint-disable-next-line no-console
|
|
138
|
+
console.warn(`Plugin "typescript-react-query" does not support GraphQL Subscriptions at the moment! Ignoring "${node.name.value}"...`);
|
|
139
|
+
}
|
|
140
|
+
return null;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
exports.ReactQueryVisitor = ReactQueryVisitor;
|
package/esm/config.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|