We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 021561e + 1edf746 commit 2815b45Copy full SHA for 2815b45
content/graphql/complexity.md
@@ -84,3 +84,14 @@ Alternatively, you can define the estimator function:
84
@Field({ complexity: (options: ComplexityEstimatorArgs) => ... })
85
title: string;
86
```
87
+
88
+#### Query/Mutation-level complexity
89
90
+In addition, `@Query()` and `@Mutation()` decorators may have a `complexity` property specified like so:
91
92
+```typescript
93
+@Query({ complexity: (options: ComplexityEstimatorArgs) => options.args.count * options.childComplexity })
94
+items(@Args('count') count: number) {
95
+ return this.itemsService.getItems({ count });
96
+}
97
+```
0 commit comments