Skip to content

Commit 79c89dc

Browse files
fix(graphql): use structure kind enum from local tsmorph lib copy
1 parent 340fc7c commit 79c89dc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/graphql/lib/graphql-ast.explorer.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
UnionTypeExtensionNode,
2222
} from 'graphql';
2323
import { get, map, sortBy, upperFirst } from 'lodash';
24-
import {
24+
import type {
2525
ClassDeclarationStructure,
2626
EnumDeclarationStructure,
2727
InterfaceDeclarationStructure,
@@ -32,7 +32,6 @@ import {
3232
PropertyDeclarationStructure,
3333
PropertySignatureStructure,
3434
SourceFile,
35-
StructureKind,
3635
TypeAliasDeclarationStructure,
3736
} from 'ts-morph';
3837
import { DEFINITIONS_FILE_HEADER } from './graphql.constants';
@@ -136,7 +135,7 @@ export class GraphQLAstExplorer {
136135
);
137136

138137
fileStructure.statements.push({
139-
kind: StructureKind.TypeAlias,
138+
kind: tsMorphLib.StructureKind.TypeAlias,
140139
name: 'Nullable',
141140
isExported: false,
142141
type: 'T | null',
@@ -444,7 +443,7 @@ export class GraphQLAstExplorer {
444443
typeof typeMapping === 'string' ? typeMapping : typeMapping?.name;
445444

446445
return {
447-
kind: StructureKind.TypeAlias,
446+
kind: tsMorphLib.StructureKind.TypeAlias,
448447
name,
449448
type: mappedTypeName ?? options.defaultScalarType ?? 'any',
450449
isExported: true,
@@ -464,7 +463,7 @@ export class GraphQLAstExplorer {
464463
(value) => `"${get(value, 'name.value')}"`,
465464
);
466465
return {
467-
kind: StructureKind.TypeAlias,
466+
kind: tsMorphLib.StructureKind.TypeAlias,
468467
name,
469468
type: values.join(' | '),
470469
isExported: true,
@@ -475,7 +474,7 @@ export class GraphQLAstExplorer {
475474
value: get(value, 'name.value'),
476475
}));
477476
return {
478-
kind: StructureKind.Enum,
477+
kind: tsMorphLib.StructureKind.Enum,
479478
name,
480479
members,
481480
isExported: true,
@@ -494,7 +493,7 @@ export class GraphQLAstExplorer {
494493
);
495494

496495
return {
497-
kind: StructureKind.TypeAlias,
496+
kind: tsMorphLib.StructureKind.TypeAlias,
498497
name,
499498
type: types.join(' | '),
500499
isExported: true,

0 commit comments

Comments
 (0)