@graphql-codegen/typescript-react-query 4.0.6 → 5.0.0-alpha-20230524082546-d7e1d0a4a
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 +0 -2
- package/cjs/fetcher-custom-mapper.js +5 -3
- package/cjs/fetcher-fetch-hardcoded.js +4 -2
- package/cjs/fetcher-fetch.js +1 -1
- package/cjs/fetcher-graphql-request.js +1 -1
- package/cjs/fetcher.js +0 -2
- package/cjs/index.js +9 -3
- package/cjs/visitor.js +7 -5
- package/esm/config.js +0 -1
- package/esm/fetcher-custom-mapper.js +7 -5
- package/esm/fetcher-fetch-hardcoded.js +4 -2
- package/esm/fetcher-fetch.js +1 -1
- package/esm/fetcher-graphql-request.js +1 -1
- package/esm/fetcher.js +0 -1
- package/esm/index.js +10 -4
- package/esm/visitor.js +7 -5
- package/package.json +6 -3
- package/typings/config.d.cts +2 -2
- package/typings/config.d.ts +2 -2
- package/typings/fetcher-custom-mapper.d.cts +1 -1
- package/typings/fetcher-custom-mapper.d.ts +1 -1
- package/typings/fetcher-fetch-hardcoded.d.cts +2 -2
- package/typings/fetcher-fetch-hardcoded.d.ts +2 -2
- package/typings/fetcher-fetch.d.cts +1 -1
- package/typings/fetcher-fetch.d.ts +1 -1
- package/typings/fetcher-graphql-request.d.cts +1 -1
- package/typings/fetcher-graphql-request.d.ts +1 -1
- package/typings/visitor.d.cts +3 -3
- package/typings/visitor.d.ts +3 -3
package/cjs/config.js
CHANGED
|
@@ -34,10 +34,12 @@ class CustomMapperFetcher {
|
|
|
34
34
|
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
35
35
|
const options = `options?: ${hookConfig.infiniteQuery.options}<${operationResultType}, TError, TData>`;
|
|
36
36
|
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
37
|
-
const implHookOuter = this._isReactHook
|
|
37
|
+
const implHookOuter = this._isReactHook
|
|
38
|
+
? `const query = ${typedFetcher}(${documentVariableName})`
|
|
39
|
+
: '';
|
|
38
40
|
const impl = this._isReactHook
|
|
39
|
-
? `(metaData) => query({...variables, ...(metaData.pageParam
|
|
40
|
-
: `(metaData) => ${typedFetcher}(${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
41
|
+
? `(metaData) => query({...variables, ...(metaData.pageParam ?? {})})`
|
|
42
|
+
: `(metaData) => ${typedFetcher}(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})()`;
|
|
41
43
|
return `export const useInfinite${operationName} = <
|
|
42
44
|
TData = ${operationResultType},
|
|
43
45
|
TError = ${this.visitor.config.errorType}
|
|
@@ -19,7 +19,9 @@ class HardcodedFetchFetcher {
|
|
|
19
19
|
getFetchParams() {
|
|
20
20
|
let fetchParamsPartial = '';
|
|
21
21
|
if (this.config.fetchParams) {
|
|
22
|
-
const fetchParamsString = typeof this.config.fetchParams === 'string'
|
|
22
|
+
const fetchParamsString = typeof this.config.fetchParams === 'string'
|
|
23
|
+
? this.config.fetchParams
|
|
24
|
+
: JSON.stringify(this.config.fetchParams);
|
|
23
25
|
fetchParamsPartial = `\n ...(${fetchParamsString}),`;
|
|
24
26
|
}
|
|
25
27
|
return ` method: "POST",${fetchParamsPartial}`;
|
|
@@ -61,7 +63,7 @@ ${this.getFetchParams()}
|
|
|
61
63
|
) =>
|
|
62
64
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
63
65
|
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
64
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
66
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
65
67
|
options
|
|
66
68
|
);`;
|
|
67
69
|
}
|
package/cjs/fetcher-fetch.js
CHANGED
|
@@ -45,7 +45,7 @@ function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit,
|
|
|
45
45
|
) =>
|
|
46
46
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
47
47
|
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
48
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
48
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
49
49
|
options
|
|
50
50
|
);`;
|
|
51
51
|
}
|
|
@@ -36,7 +36,7 @@ function fetcher<TData, TVariables extends { [key: string]: any }>(client: Graph
|
|
|
36
36
|
) =>
|
|
37
37
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
38
38
|
${(0, variables_generator_js_1.generateInfiniteQueryKey)(node, hasRequiredVariables)},
|
|
39
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
39
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})}, headers)(),
|
|
40
40
|
options
|
|
41
41
|
);`;
|
|
42
42
|
}
|
package/cjs/fetcher.js
CHANGED
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReactQueryVisitor = exports.validate = exports.plugin = void 0;
|
|
4
|
+
const path_1 = require("path");
|
|
4
5
|
const graphql_1 = require("graphql");
|
|
5
6
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
6
7
|
const visitor_js_1 = require("./visitor.js");
|
|
7
8
|
Object.defineProperty(exports, "ReactQueryVisitor", { enumerable: true, get: function () { return visitor_js_1.ReactQueryVisitor; } });
|
|
8
|
-
const path_1 = require("path");
|
|
9
9
|
const plugin = (schema, documents, config) => {
|
|
10
10
|
const allAst = (0, graphql_1.concatAST)(documents.map(v => v.document));
|
|
11
11
|
const allFragments = [
|
|
@@ -22,12 +22,18 @@ const plugin = (schema, documents, config) => {
|
|
|
22
22
|
if (visitor.hasOperations) {
|
|
23
23
|
return {
|
|
24
24
|
prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
|
|
25
|
-
content: [
|
|
25
|
+
content: [
|
|
26
|
+
visitor.fragments,
|
|
27
|
+
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
28
|
+
].join('\n'),
|
|
26
29
|
};
|
|
27
30
|
}
|
|
28
31
|
return {
|
|
29
32
|
prepend: [...visitor.getImports()],
|
|
30
|
-
content: [
|
|
33
|
+
content: [
|
|
34
|
+
visitor.fragments,
|
|
35
|
+
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
36
|
+
].join('\n'),
|
|
31
37
|
};
|
|
32
38
|
};
|
|
33
39
|
exports.plugin = plugin;
|
package/cjs/visitor.js
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ReactQueryVisitor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
6
|
+
const change_case_all_1 = require("change-case-all");
|
|
5
7
|
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
6
|
-
const variables_generator_js_1 = require("./variables-generator.js");
|
|
7
8
|
const fetcher_custom_mapper_js_1 = require("./fetcher-custom-mapper.js");
|
|
9
|
+
const fetcher_fetch_hardcoded_js_1 = require("./fetcher-fetch-hardcoded.js");
|
|
8
10
|
const fetcher_fetch_js_1 = require("./fetcher-fetch.js");
|
|
9
11
|
const fetcher_graphql_request_js_1 = require("./fetcher-graphql-request.js");
|
|
10
|
-
const
|
|
11
|
-
const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
|
|
12
|
-
const change_case_all_1 = require("change-case-all");
|
|
12
|
+
const variables_generator_js_1 = require("./variables-generator.js");
|
|
13
13
|
class ReactQueryVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
|
|
14
14
|
constructor(schema, fragments, rawConfig, documents) {
|
|
15
15
|
super(schema, fragments, rawConfig, {
|
|
@@ -39,7 +39,9 @@ class ReactQueryVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
|
|
|
39
39
|
options: 'UseMutationOptions',
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
|
-
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
42
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
43
|
+
? `${this.config.importOperationTypesFrom}.`
|
|
44
|
+
: '';
|
|
43
45
|
this._documents = documents;
|
|
44
46
|
this.fetcher = this.createFetcher(rawConfig.fetcher || 'fetch');
|
|
45
47
|
(0, auto_bind_1.default)(this);
|
package/esm/config.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { buildMapperImport, parseMapper } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
-
import { generateInfiniteQueryKey, generateMutationKey, generateQueryKey } from './variables-generator.js';
|
|
1
|
+
import { buildMapperImport, parseMapper, } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
+
import { generateInfiniteQueryKey, generateMutationKey, generateQueryKey, } from './variables-generator.js';
|
|
3
3
|
export class CustomMapperFetcher {
|
|
4
4
|
constructor(visitor, customFetcher) {
|
|
5
5
|
this.visitor = visitor;
|
|
@@ -31,10 +31,12 @@ export class CustomMapperFetcher {
|
|
|
31
31
|
this.visitor.reactQueryOptionsIdentifiersInUse.add(hookConfig.infiniteQuery.options);
|
|
32
32
|
const options = `options?: ${hookConfig.infiniteQuery.options}<${operationResultType}, TError, TData>`;
|
|
33
33
|
const typedFetcher = this.getFetcherFnName(operationResultType, operationVariablesTypes);
|
|
34
|
-
const implHookOuter = this._isReactHook
|
|
34
|
+
const implHookOuter = this._isReactHook
|
|
35
|
+
? `const query = ${typedFetcher}(${documentVariableName})`
|
|
36
|
+
: '';
|
|
35
37
|
const impl = this._isReactHook
|
|
36
|
-
? `(metaData) => query({...variables, ...(metaData.pageParam
|
|
37
|
-
: `(metaData) => ${typedFetcher}(${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
38
|
+
? `(metaData) => query({...variables, ...(metaData.pageParam ?? {})})`
|
|
39
|
+
: `(metaData) => ${typedFetcher}(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})()`;
|
|
38
40
|
return `export const useInfinite${operationName} = <
|
|
39
41
|
TData = ${operationResultType},
|
|
40
42
|
TError = ${this.visitor.config.errorType}
|
|
@@ -16,7 +16,9 @@ export class HardcodedFetchFetcher {
|
|
|
16
16
|
getFetchParams() {
|
|
17
17
|
let fetchParamsPartial = '';
|
|
18
18
|
if (this.config.fetchParams) {
|
|
19
|
-
const fetchParamsString = typeof this.config.fetchParams === 'string'
|
|
19
|
+
const fetchParamsString = typeof this.config.fetchParams === 'string'
|
|
20
|
+
? this.config.fetchParams
|
|
21
|
+
: JSON.stringify(this.config.fetchParams);
|
|
20
22
|
fetchParamsPartial = `\n ...(${fetchParamsString}),`;
|
|
21
23
|
}
|
|
22
24
|
return ` method: "POST",${fetchParamsPartial}`;
|
|
@@ -58,7 +60,7 @@ ${this.getFetchParams()}
|
|
|
58
60
|
) =>
|
|
59
61
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
60
62
|
${generateInfiniteQueryKey(node, hasRequiredVariables)},
|
|
61
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
63
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
62
64
|
options
|
|
63
65
|
);`;
|
|
64
66
|
}
|
package/esm/fetcher-fetch.js
CHANGED
|
@@ -42,7 +42,7 @@ function fetcher<TData, TVariables>(endpoint: string, requestInit: RequestInit,
|
|
|
42
42
|
) =>
|
|
43
43
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
44
44
|
${generateInfiniteQueryKey(node, hasRequiredVariables)},
|
|
45
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
45
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(dataSource.endpoint, dataSource.fetchParams || {}, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})})(),
|
|
46
46
|
options
|
|
47
47
|
);`;
|
|
48
48
|
}
|
|
@@ -33,7 +33,7 @@ function fetcher<TData, TVariables extends { [key: string]: any }>(client: Graph
|
|
|
33
33
|
) =>
|
|
34
34
|
${hookConfig.infiniteQuery.hook}<${operationResultType}, TError, TData>(
|
|
35
35
|
${generateInfiniteQueryKey(node, hasRequiredVariables)},
|
|
36
|
-
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam
|
|
36
|
+
(metaData) => fetcher<${operationResultType}, ${operationVariablesTypes}>(client, ${documentVariableName}, {...variables, ...(metaData.pageParam ?? {})}, headers)(),
|
|
37
37
|
options
|
|
38
38
|
);`;
|
|
39
39
|
}
|
package/esm/fetcher.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { extname } from 'path';
|
|
2
|
+
import { concatAST, Kind } from 'graphql';
|
|
2
3
|
import { oldVisit } from '@graphql-codegen/plugin-helpers';
|
|
3
4
|
import { ReactQueryVisitor } from './visitor.js';
|
|
4
|
-
import { extname } from 'path';
|
|
5
5
|
export const plugin = (schema, documents, config) => {
|
|
6
6
|
const allAst = concatAST(documents.map(v => v.document));
|
|
7
7
|
const allFragments = [
|
|
@@ -18,12 +18,18 @@ export const plugin = (schema, documents, config) => {
|
|
|
18
18
|
if (visitor.hasOperations) {
|
|
19
19
|
return {
|
|
20
20
|
prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
|
|
21
|
-
content: [
|
|
21
|
+
content: [
|
|
22
|
+
visitor.fragments,
|
|
23
|
+
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
24
|
+
].join('\n'),
|
|
22
25
|
};
|
|
23
26
|
}
|
|
24
27
|
return {
|
|
25
28
|
prepend: [...visitor.getImports()],
|
|
26
|
-
content: [
|
|
29
|
+
content: [
|
|
30
|
+
visitor.fragments,
|
|
31
|
+
...visitorResult.definitions.filter(t => typeof t === 'string'),
|
|
32
|
+
].join('\n'),
|
|
27
33
|
};
|
|
28
34
|
};
|
|
29
35
|
export const validate = async (schema, documents, config, outputFile) => {
|
package/esm/visitor.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
import autoBind from 'auto-bind';
|
|
2
|
+
import { pascalCase } from 'change-case-all';
|
|
1
3
|
import { ClientSideBaseVisitor, DocumentMode, getConfigValue, } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
-
import { generateMutationKeyMaker, generateQueryKeyMaker, generateInfiniteQueryKeyMaker, } from './variables-generator.js';
|
|
3
4
|
import { CustomMapperFetcher } from './fetcher-custom-mapper.js';
|
|
5
|
+
import { HardcodedFetchFetcher } from './fetcher-fetch-hardcoded.js';
|
|
4
6
|
import { FetchFetcher } from './fetcher-fetch.js';
|
|
5
7
|
import { GraphQLRequestClientFetcher } from './fetcher-graphql-request.js';
|
|
6
|
-
import {
|
|
7
|
-
import autoBind from 'auto-bind';
|
|
8
|
-
import { pascalCase } from 'change-case-all';
|
|
8
|
+
import { generateInfiniteQueryKeyMaker, generateMutationKeyMaker, generateQueryKeyMaker, } from './variables-generator.js';
|
|
9
9
|
export class ReactQueryVisitor extends ClientSideBaseVisitor {
|
|
10
10
|
constructor(schema, fragments, rawConfig, documents) {
|
|
11
11
|
super(schema, fragments, rawConfig, {
|
|
@@ -35,7 +35,9 @@ export class ReactQueryVisitor extends ClientSideBaseVisitor {
|
|
|
35
35
|
options: 'UseMutationOptions',
|
|
36
36
|
},
|
|
37
37
|
};
|
|
38
|
-
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
38
|
+
this._externalImportPrefix = this.config.importOperationTypesFrom
|
|
39
|
+
? `${this.config.importOperationTypesFrom}.`
|
|
40
|
+
: '';
|
|
39
41
|
this._documents = documents;
|
|
40
42
|
this.fetcher = this.createFetcher(rawConfig.fetcher || 'fetch');
|
|
41
43
|
autoBind(this);
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-react-query",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-alpha-20230524082546-d7e1d0a4a",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating a ready-to-use React-Query Hooks based on GraphQL operations",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "^
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^3.0.0",
|
|
10
10
|
"@graphql-codegen/visitor-plugin-common": "2.13.1",
|
|
11
11
|
"auto-bind": "~4.0.0",
|
|
12
|
-
"change-case-all": "1.0.
|
|
12
|
+
"change-case-all": "1.0.15",
|
|
13
13
|
"tslib": "~2.4.0"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"directory": "packages/plugins/typescript/react-query"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">= 16.0.0"
|
|
23
|
+
},
|
|
21
24
|
"main": "cjs/index.js",
|
|
22
25
|
"module": "esm/index.js",
|
|
23
26
|
"typings": "typings/index.d.ts",
|
package/typings/config.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
-
export
|
|
2
|
+
export type HardcodedFetch = {
|
|
3
3
|
endpoint: string;
|
|
4
4
|
fetchParams?: string | Record<string, any>;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type CustomFetch = {
|
|
7
7
|
func: string;
|
|
8
8
|
isReactHook?: boolean;
|
|
9
9
|
} | string;
|
package/typings/config.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { RawClientSideBasePluginConfig } from '@graphql-codegen/visitor-plugin-common';
|
|
2
|
-
export
|
|
2
|
+
export type HardcodedFetch = {
|
|
3
3
|
endpoint: string;
|
|
4
4
|
fetchParams?: string | Record<string, any>;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
6
|
+
export type CustomFetch = {
|
|
7
7
|
func: string;
|
|
8
8
|
isReactHook?: boolean;
|
|
9
9
|
} | string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { OperationDefinitionNode } from 'graphql';
|
|
1
2
|
import { CustomFetch } from './config.cjs';
|
|
2
3
|
import { FetcherRenderer } from './fetcher.cjs';
|
|
3
|
-
import { OperationDefinitionNode } from 'graphql';
|
|
4
4
|
import { ReactQueryVisitor } from './visitor.cjs';
|
|
5
5
|
export declare class CustomMapperFetcher implements FetcherRenderer {
|
|
6
6
|
private visitor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { OperationDefinitionNode } from 'graphql';
|
|
1
2
|
import { CustomFetch } from './config.js';
|
|
2
3
|
import { FetcherRenderer } from './fetcher.js';
|
|
3
|
-
import { OperationDefinitionNode } from 'graphql';
|
|
4
4
|
import { ReactQueryVisitor } from './visitor.js';
|
|
5
5
|
export declare class CustomMapperFetcher implements FetcherRenderer {
|
|
6
6
|
private visitor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.cjs';
|
|
2
|
-
import { HardcodedFetch } from './config.cjs';
|
|
3
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { HardcodedFetch } from './config.cjs';
|
|
3
|
+
import { FetcherRenderer } from './fetcher.cjs';
|
|
4
4
|
import { ReactQueryVisitor } from './visitor.cjs';
|
|
5
5
|
export declare class HardcodedFetchFetcher implements FetcherRenderer {
|
|
6
6
|
private visitor;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.js';
|
|
2
|
-
import { HardcodedFetch } from './config.js';
|
|
3
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { HardcodedFetch } from './config.js';
|
|
3
|
+
import { FetcherRenderer } from './fetcher.js';
|
|
4
4
|
import { ReactQueryVisitor } from './visitor.js';
|
|
5
5
|
export declare class HardcodedFetchFetcher implements FetcherRenderer {
|
|
6
6
|
private visitor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.cjs';
|
|
2
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { FetcherRenderer } from './fetcher.cjs';
|
|
3
3
|
import { ReactQueryVisitor } from './visitor.cjs';
|
|
4
4
|
export declare class FetchFetcher implements FetcherRenderer {
|
|
5
5
|
private visitor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.js';
|
|
2
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { FetcherRenderer } from './fetcher.js';
|
|
3
3
|
import { ReactQueryVisitor } from './visitor.js';
|
|
4
4
|
export declare class FetchFetcher implements FetcherRenderer {
|
|
5
5
|
private visitor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.cjs';
|
|
2
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { FetcherRenderer } from './fetcher.cjs';
|
|
3
3
|
import { ReactQueryVisitor } from './visitor.cjs';
|
|
4
4
|
export declare class GraphQLRequestClientFetcher implements FetcherRenderer {
|
|
5
5
|
private visitor;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FetcherRenderer } from './fetcher.js';
|
|
2
1
|
import { OperationDefinitionNode } from 'graphql';
|
|
2
|
+
import { FetcherRenderer } from './fetcher.js';
|
|
3
3
|
import { ReactQueryVisitor } from './visitor.js';
|
|
4
4
|
export declare class GraphQLRequestClientFetcher implements FetcherRenderer {
|
|
5
5
|
private visitor;
|
package/typings/visitor.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
3
|
-
import { FetcherRenderer } from './fetcher.cjs';
|
|
4
|
-
import { ReactQueryRawPluginConfig } from './config.cjs';
|
|
5
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
4
|
+
import { ReactQueryRawPluginConfig } from './config.cjs';
|
|
5
|
+
import { FetcherRenderer } from './fetcher.cjs';
|
|
6
6
|
export interface ReactQueryPluginConfig extends ClientSideBasePluginConfig {
|
|
7
7
|
errorType: string;
|
|
8
8
|
exposeDocument: boolean;
|
package/typings/visitor.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
2
1
|
import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
|
|
3
|
-
import { FetcherRenderer } from './fetcher.js';
|
|
4
|
-
import { ReactQueryRawPluginConfig } from './config.js';
|
|
5
2
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
3
|
+
import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
|
|
4
|
+
import { ReactQueryRawPluginConfig } from './config.js';
|
|
5
|
+
import { FetcherRenderer } from './fetcher.js';
|
|
6
6
|
export interface ReactQueryPluginConfig extends ClientSideBasePluginConfig {
|
|
7
7
|
errorType: string;
|
|
8
8
|
exposeDocument: boolean;
|