@graphql-codegen/typescript-react-query 7.0.1 → 7.0.2-alpha-20260602115859-241f544bc20eb0a98dbf7537b94ed21758db1442

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/index.js CHANGED
@@ -4,6 +4,7 @@ exports.ReactQueryVisitor = exports.validate = exports.plugin = void 0;
4
4
  const path_1 = require("path");
5
5
  const graphql_1 = require("graphql");
6
6
  const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
7
+ const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
7
8
  const visitor_js_1 = require("./visitor.js");
8
9
  Object.defineProperty(exports, "ReactQueryVisitor", { enumerable: true, get: function () { return visitor_js_1.ReactQueryVisitor; } });
9
10
  const plugin = (schema, documents, config) => {
@@ -24,6 +25,7 @@ const plugin = (schema, documents, config) => {
24
25
  prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
25
26
  content: [
26
27
  '',
28
+ visitor_plugin_common_1.typedDocumentString.template,
27
29
  visitor.fragments,
28
30
  ...visitorResult.definitions.filter(t => typeof t === 'string'),
29
31
  ].join('\n'),
package/cjs/visitor.js CHANGED
@@ -67,7 +67,12 @@ class ReactQueryVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
67
67
  : this.config.reactQueryVersion <= 3
68
68
  ? 'react-query'
69
69
  : '@tanstack/react-query';
70
- return [...baseImports, `import { ${hookAndTypeImports.join(', ')} } from '${moduleName}';`];
70
+ const typedDocumentStringPropImport = this._generateImport(visitor_plugin_common_1.typedDocumentString.import, visitor_plugin_common_1.typedDocumentString.import.propName, true);
71
+ return [
72
+ ...baseImports,
73
+ typedDocumentStringPropImport,
74
+ `import { ${hookAndTypeImports.join(', ')} } from '${moduleName}';`,
75
+ ];
71
76
  }
72
77
  getFetcherImplementation() {
73
78
  return this.fetcher.generateFetcherImplementation();
package/esm/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { extname } from 'path';
2
2
  import { concatAST, Kind } from 'graphql';
3
3
  import { oldVisit } from '@graphql-codegen/plugin-helpers';
4
+ import { typedDocumentString } from '@graphql-codegen/visitor-plugin-common';
4
5
  import { ReactQueryVisitor } from './visitor.js';
5
6
  export const plugin = (schema, documents, config) => {
6
7
  const allAst = concatAST(documents.map(v => v.document));
@@ -20,6 +21,7 @@ export const plugin = (schema, documents, config) => {
20
21
  prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
21
22
  content: [
22
23
  '',
24
+ typedDocumentString.template,
23
25
  visitor.fragments,
24
26
  ...visitorResult.definitions.filter(t => typeof t === 'string'),
25
27
  ].join('\n'),
package/esm/visitor.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import autoBind from 'auto-bind';
2
2
  import { pascalCase } from 'change-case-all';
3
- import { ClientSideBaseVisitor, DocumentMode, getConfigValue, } from '@graphql-codegen/visitor-plugin-common';
3
+ import { ClientSideBaseVisitor, DocumentMode, getConfigValue, typedDocumentString, } from '@graphql-codegen/visitor-plugin-common';
4
4
  import { CustomMapperFetcher } from './fetcher-custom-mapper.js';
5
5
  import { HardcodedFetchFetcher } from './fetcher-fetch-hardcoded.js';
6
6
  import { FetchFetcher } from './fetcher-fetch.js';
@@ -63,7 +63,12 @@ export class ReactQueryVisitor extends ClientSideBaseVisitor {
63
63
  : this.config.reactQueryVersion <= 3
64
64
  ? 'react-query'
65
65
  : '@tanstack/react-query';
66
- return [...baseImports, `import { ${hookAndTypeImports.join(', ')} } from '${moduleName}';`];
66
+ const typedDocumentStringPropImport = this._generateImport(typedDocumentString.import, typedDocumentString.import.propName, true);
67
+ return [
68
+ ...baseImports,
69
+ typedDocumentStringPropImport,
70
+ `import { ${hookAndTypeImports.join(', ')} } from '${moduleName}';`,
71
+ ];
67
72
  }
68
73
  getFetcherImplementation() {
69
74
  return this.fetcher.generateFetcherImplementation();
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-react-query",
3
- "version": "7.0.1",
3
+ "version": "7.0.2-alpha-20260602115859-241f544bc20eb0a98dbf7537b94ed21758db1442",
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": "^6.3.0",
10
- "@graphql-codegen/visitor-plugin-common": "^6.3.0",
9
+ "@graphql-codegen/plugin-helpers": "^7.0.1",
10
+ "@graphql-codegen/visitor-plugin-common": "^7.1.0",
11
11
  "auto-bind": "~4.0.0",
12
12
  "change-case-all": "1.0.15",
13
13
  "tslib": "^2.8.1"