@graphql-codegen/typescript-graphql-request 6.0.0 → 6.0.1-alpha-20231024141603-98360b670

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
@@ -21,8 +21,13 @@ class GraphQLRequestVisitor extends visitor_plugin_common_1.ClientSideBaseVisito
21
21
  const buildPath = this.config.emitLegacyCommonJSImports ? 'cjs' : 'esm';
22
22
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
23
23
  this._additionalImports.push(`${typeImport} { GraphQLClientRequestHeaders } from 'graphql-request/build/${buildPath}/types${fileExtension}';`);
24
- if (this.config.rawRequest && this.config.documentMode !== visitor_plugin_common_1.DocumentMode.string) {
25
- this._additionalImports.push(`import { print } from 'graphql'`);
24
+ if (this.config.rawRequest) {
25
+ if (this.config.documentMode !== visitor_plugin_common_1.DocumentMode.string) {
26
+ this._additionalImports.push(`import { GraphQLError, print } from 'graphql'`);
27
+ }
28
+ else {
29
+ this._additionalImports.push(`import { GraphQLError } from 'graphql'`);
30
+ }
26
31
  }
27
32
  this._externalImportPrefix = this.config.importOperationTypesFrom
28
33
  ? `${this.config.importOperationTypesFrom}.`
package/esm/visitor.js CHANGED
@@ -17,8 +17,13 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor {
17
17
  const buildPath = this.config.emitLegacyCommonJSImports ? 'cjs' : 'esm';
18
18
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
19
19
  this._additionalImports.push(`${typeImport} { GraphQLClientRequestHeaders } from 'graphql-request/build/${buildPath}/types${fileExtension}';`);
20
- if (this.config.rawRequest && this.config.documentMode !== DocumentMode.string) {
21
- this._additionalImports.push(`import { print } from 'graphql'`);
20
+ if (this.config.rawRequest) {
21
+ if (this.config.documentMode !== DocumentMode.string) {
22
+ this._additionalImports.push(`import { GraphQLError, print } from 'graphql'`);
23
+ }
24
+ else {
25
+ this._additionalImports.push(`import { GraphQLError } from 'graphql'`);
26
+ }
22
27
  }
23
28
  this._externalImportPrefix = this.config.importOperationTypesFrom
24
29
  ? `${this.config.importOperationTypesFrom}.`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-graphql-request",
3
- "version": "6.0.0",
3
+ "version": "6.0.1-alpha-20231024141603-98360b670",
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",