Skip to content

Commit

Permalink
fix: handle undefined namedType for introspection (#8390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Diizzayy committed Oct 24, 2022
1 parent 27cc3f4 commit 12ecbe0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eighty-trees-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphql-codegen/typescript': major
---

handle undefined namedType when including introspection type definitions
2 changes: 1 addition & 1 deletion packages/plugins/typescript/typescript/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function includeIntrospectionTypesDefinitions(
Field() {
const type = getNamedType(typeInfo.getType());

if (isIntrospectionType(type) && !usedTypes.includes(type)) {
if (type && isIntrospectionType(type) && !usedTypes.includes(type)) {
usedTypes.push(type);
}
},
Expand Down

0 comments on commit 12ecbe0

Please sign in to comment.