@graphql-codegen/typescript-graphql-request 4.4.3 → 4.4.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.
Files changed (3) hide show
  1. package/index.js +1 -2
  2. package/index.mjs +1 -2
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -25,7 +25,6 @@ class GraphQLRequestVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
25
25
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
26
26
  this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom';`);
27
27
  if (this.config.rawRequest) {
28
- this._additionalImports.push(`${typeImport} { GraphQLError } from 'graphql-request/dist/types';`);
29
28
  if (this.config.documentMode !== visitorPluginCommon.DocumentMode.string) {
30
29
  this._additionalImports.push(`import { print } from 'graphql'`);
31
30
  }
@@ -72,7 +71,7 @@ class GraphQLRequestVisitor extends visitorPluginCommon.ClientSideBaseVisitor {
72
71
  docArg = `${docVarName}String`;
73
72
  extraVariables.push(`const ${docArg} = print(${docVarName});`);
74
73
  }
75
- return `${operationName}(variables${optionalVariables ? '?' : ''}: ${o.operationVariablesTypes}, requestHeaders?: Dom.RequestInit["headers"]): Promise<{ data?: ${o.operationResultType} | undefined; extensions?: ${this.config.extensionsType}; headers: Dom.Headers; status: number; errors?: GraphQLError[] | undefined; }> {
74
+ return `${operationName}(variables${optionalVariables ? '?' : ''}: ${o.operationVariablesTypes}, requestHeaders?: Dom.RequestInit["headers"]): Promise<{ data: ${o.operationResultType}; extensions?: ${this.config.extensionsType}; headers: Dom.Headers; status: number; }> {
76
75
  return withWrapper((wrappedRequestHeaders) => client.rawRequest<${o.operationResultType}>(${docArg}, variables, {...requestHeaders, ...wrappedRequestHeaders}), '${operationName}', '${operationType}');
77
76
  }`;
78
77
  }
package/index.mjs CHANGED
@@ -19,7 +19,6 @@ class GraphQLRequestVisitor extends ClientSideBaseVisitor {
19
19
  this._additionalImports.push(`${typeImport} { GraphQLClient } from 'graphql-request';`);
20
20
  this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom';`);
21
21
  if (this.config.rawRequest) {
22
- this._additionalImports.push(`${typeImport} { GraphQLError } from 'graphql-request/dist/types';`);
23
22
  if (this.config.documentMode !== DocumentMode.string) {
24
23
  this._additionalImports.push(`import { print } from 'graphql'`);
25
24
  }
@@ -66,7 +65,7 @@ class GraphQLRequestVisitor extends ClientSideBaseVisitor {
66
65
  docArg = `${docVarName}String`;
67
66
  extraVariables.push(`const ${docArg} = print(${docVarName});`);
68
67
  }
69
- return `${operationName}(variables${optionalVariables ? '?' : ''}: ${o.operationVariablesTypes}, requestHeaders?: Dom.RequestInit["headers"]): Promise<{ data?: ${o.operationResultType} | undefined; extensions?: ${this.config.extensionsType}; headers: Dom.Headers; status: number; errors?: GraphQLError[] | undefined; }> {
68
+ return `${operationName}(variables${optionalVariables ? '?' : ''}: ${o.operationVariablesTypes}, requestHeaders?: Dom.RequestInit["headers"]): Promise<{ data: ${o.operationResultType}; extensions?: ${this.config.extensionsType}; headers: Dom.Headers; status: number; }> {
70
69
  return withWrapper((wrappedRequestHeaders) => client.rawRequest<${o.operationResultType}>(${docArg}, variables, {...requestHeaders, ...wrappedRequestHeaders}), '${operationName}', '${operationType}');
71
70
  }`;
72
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-graphql-request",
3
- "version": "4.4.3",
3
+ "version": "4.4.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",