@graphql-codegen/typescript-react-query 3.0.3 → 3.1.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.
Files changed (3) hide show
  1. package/index.js +2 -1
  2. package/index.mjs +3 -2
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -4,6 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
6
6
 
7
+ const pluginHelpers = require('@graphql-codegen/plugin-helpers');
7
8
  const graphql = require('graphql');
8
9
  const visitorPluginCommon = require('@graphql-codegen/visitor-plugin-common');
9
10
  const autoBind = _interopDefault(require('auto-bind'));
@@ -428,7 +429,7 @@ const plugin = (schema, documents, config) => {
428
429
  ...(config.externalFragments || []),
429
430
  ];
430
431
  const visitor = new ReactQueryVisitor(schema, allFragments, config, documents);
431
- const visitorResult = graphql.visit(allAst, { leave: visitor });
432
+ const visitorResult = pluginHelpers.oldVisit(allAst, { leave: visitor });
432
433
  if (visitor.hasOperations) {
433
434
  return {
434
435
  prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
package/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- import { concatAST, Kind, visit } from 'graphql';
1
+ import { oldVisit } from '@graphql-codegen/plugin-helpers';
2
+ import { concatAST, Kind } from 'graphql';
2
3
  import { parseMapper, buildMapperImport, ClientSideBaseVisitor, DocumentMode, getConfigValue } from '@graphql-codegen/visitor-plugin-common';
3
4
  import autoBind from 'auto-bind';
4
5
  import { pascalCase } from 'change-case-all';
@@ -422,7 +423,7 @@ const plugin = (schema, documents, config) => {
422
423
  ...(config.externalFragments || []),
423
424
  ];
424
425
  const visitor = new ReactQueryVisitor(schema, allFragments, config, documents);
425
- const visitorResult = visit(allAst, { leave: visitor });
426
+ const visitorResult = oldVisit(allAst, { leave: visitor });
426
427
  if (visitor.hasOperations) {
427
428
  return {
428
429
  prepend: [...visitor.getImports(), visitor.getFetcherImplementation()],
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-react-query",
3
- "version": "3.0.3",
3
+ "version": "3.1.0",
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",
7
7
  "graphql-tag": "^2.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@graphql-codegen/plugin-helpers": "^2.2.0",
11
- "@graphql-codegen/visitor-plugin-common": "2.4.0",
10
+ "@graphql-codegen/plugin-helpers": "^2.3.0",
11
+ "@graphql-codegen/visitor-plugin-common": "2.5.0",
12
12
  "auto-bind": "~4.0.0",
13
13
  "change-case-all": "1.0.14",
14
14
  "tslib": "~2.3.0"