@graphql-codegen/typescript-graphql-request 4.5.4 → 4.5.5

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/visitor.js CHANGED
@@ -17,8 +17,9 @@ class GraphQLRequestVisitor extends visitor_plugin_common_1.ClientSideBaseVisito
17
17
  this._operationsToInclude = [];
18
18
  (0, auto_bind_1.default)(this);
19
19
  const typeImport = this.config.useTypeImports ? 'import type' : 'import';
20
+ const fileExtension = this.config.emitLegacyCommonJSImports ? '' : '.js';
20
21
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
21
- this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom';`);
22
+ this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom${fileExtension}';`);
22
23
  if (this.config.rawRequest && this.config.documentMode !== visitor_plugin_common_1.DocumentMode.string) {
23
24
  this._additionalImports.push(`import { print } from 'graphql'`);
24
25
  }
package/esm/visitor.js CHANGED
@@ -13,8 +13,9 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor {
13
13
  this._operationsToInclude = [];
14
14
  autoBind(this);
15
15
  const typeImport = this.config.useTypeImports ? 'import type' : 'import';
16
+ const fileExtension = this.config.emitLegacyCommonJSImports ? '' : '.js';
16
17
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
17
- this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom';`);
18
+ this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom${fileExtension}';`);
18
19
  if (this.config.rawRequest && this.config.documentMode !== DocumentMode.string) {
19
20
  this._additionalImports.push(`import { print } from 'graphql'`);
20
21
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-graphql-request",
3
- "version": "4.5.4",
3
+ "version": "4.5.5",
4
4
  "description": "GraphQL Code Generator plugin for generating a ready-to-use SDK based on graphql-request and 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",
@@ -8,7 +8,7 @@
8
8
  "graphql-tag": "^2.0.0"
9
9
  },
10
10
  "dependencies": {
11
- "@graphql-codegen/plugin-helpers": "^2.7.0",
11
+ "@graphql-codegen/plugin-helpers": "^2.7.1",
12
12
  "@graphql-codegen/visitor-plugin-common": "2.12.1",
13
13
  "auto-bind": "~4.0.0",
14
14
  "tslib": "~2.4.0"