Skip to content

Commit 963f5d3

Browse files
committed
Prevent astNode is undefined for _entities & _service query
1 parent fdf7814 commit 963f5d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/estimators/directive/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ export default function (options?: {}): ComplexityEstimator {
2828
});
2929

3030
return (args: ComplexityEstimatorArgs) => {
31-
const values = getDirectiveValues(directive, args.field.astNode);
31+
const astNode = (args.field && args.field.astNode) || {};
32+
const values = getDirectiveValues(directive, astNode);
3233

3334
// Ignore if no directive set
3435
if (!values) {

0 commit comments

Comments
 (0)