Skip to content

Commit 0e7a064

Browse files
committed
Prevent astNode's value is undefined when perform _entities & _service query
1 parent fdf7814 commit 0e7a064

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/QueryComplexity.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ export default class QueryComplexity {
190190
if (!field) {
191191
break;
192192
}
193+
// Prevent astNode's value is undefined when perform `_entities` & `_service` query
194+
if (!field.astNode) {
195+
(field.astNode as any) = {}
196+
}
193197
const fieldType = getNamedType(field.type);
194198

195199
// Get arguments

0 commit comments

Comments
 (0)