Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

Commit

Permalink
fix(gg): check modelDef.getType() is defined before use (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored and Jason Kuhrt committed Jan 17, 2019
1 parent 846c06b commit 5beb821
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/graphqlgen/src/generators/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export function fieldsFromModelDefinition(
// If model is of type `type TypeName = { ... }`
if (
modelDef.kind === 'TypeAliasDefinition' &&
(modelDef as TypeAliasDefinition).getType().kind ===
'AnonymousInterfaceAnnotation'
modelDef.getType() &&
modelDef.getType().kind === 'AnonymousInterfaceAnnotation'
) {
const interfaceDef = (modelDef as TypeAliasDefinition).getType() as AnonymousInterfaceAnnotation
const interfaceDef = modelDef.getType() as AnonymousInterfaceAnnotation

return interfaceDef.fields
}
Expand Down

0 comments on commit 5beb821

Please sign in to comment.