Skip to content

Commit 7fae9fb

Browse files
authored
fix(plugins/gql-request): remove unused GraphQLError import (#7697)
* fix(plugins/gql-request): remove unused `GraphQLError` import * Create new-rats-know.md
1 parent f4b2a79 commit 7fae9fb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.changeset/new-rats-know.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphql-codegen/typescript-graphql-request": patch
3+
---
4+
5+
fix(plugins/gql-request): remove unused `GraphQLError` import

packages/plugins/typescript/graphql-request/src/visitor.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export class GraphQLRequestVisitor extends ClientSideBaseVisitor<
4545
this._additionalImports.push(`${typeImport} * as Dom from 'graphql-request/dist/types.dom';`);
4646

4747
if (this.config.rawRequest) {
48-
this._additionalImports.push(`${typeImport} { GraphQLError } from 'graphql-request/dist/types';`);
4948
if (this.config.documentMode !== DocumentMode.string) {
5049
this._additionalImports.push(`import { print } from 'graphql'`);
5150
}

packages/plugins/typescript/graphql-request/tests/__snapshots__/graphql-request.spec.ts.snap

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,6 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?:
850850
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
851851
import type { GraphQLClient } from 'graphql-request';
852852
import type * as Dom from 'graphql-request/dist/types.dom';
853-
import type { GraphQLError } from 'graphql-request/dist/types';
854853
import { print } from 'graphql'
855854
import gql from 'graphql-tag';
856855
/** All built-in and custom scalars, mapped to their actual values */
@@ -1135,7 +1134,6 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?:
11351134
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
11361135
import { GraphQLClient } from 'graphql-request';
11371136
import * as Dom from 'graphql-request/dist/types.dom';
1138-
import { GraphQLError } from 'graphql-request/dist/types';
11391137
import { print } from 'graphql'
11401138
import gql from 'graphql-tag';
11411139
/** All built-in and custom scalars, mapped to their actual values */
@@ -1420,7 +1418,6 @@ export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?:
14201418
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
14211419
import { GraphQLClient } from 'graphql-request';
14221420
import * as Dom from 'graphql-request/dist/types.dom';
1423-
import { GraphQLError } from 'graphql-request/dist/types';
14241421
import { print } from 'graphql'
14251422
import gql from 'graphql-tag';
14261423
/** All built-in and custom scalars, mapped to their actual values */

0 commit comments

Comments
 (0)