Skip to content

Commit

Permalink
Fix extensions undefined (#123)
Browse files Browse the repository at this point in the history
Co-authored-by: Naufan <[email protected]>
  • Loading branch information
nprizal and nprizal authored Jun 15, 2020
1 parent 48b58d5 commit 444bfd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/fake_definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,11 @@ export function buildWithFakeDefinitions(
if (isObjectType(type) || isInterfaceType(type)) {
for (const field of Object.values(type.getFields())) {
const isExtensionField = field.astNode?.loc?.source === extensionSDL;
(field.extensions as any)['isExtensionField'] = isExtensionField;
if (field.extensions) {
(field.extensions as any)['isExtensionField'] = isExtensionField;
} else {
field.extensions = { isExtensionField };
}
}
}
}
Expand Down

0 comments on commit 444bfd7

Please sign in to comment.