File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,13 @@ $ npm install --save graphql-query-complexity
19
19
Once the installation process is complete, we can define the ` ComplexityPlugin ` class:
20
20
21
21
``` typescript
22
- import { GraphQLSchemaHost } from " @nestjs/graphql" ;
23
- import { Plugin } from " @nestjs/apollo" ;
22
+ import { GraphQLSchemaHost } from ' @nestjs/graphql' ;
23
+ import { Plugin } from ' @nestjs/apollo' ;
24
24
import {
25
25
ApolloServerPlugin ,
26
+ BaseContext ,
26
27
GraphQLRequestListener ,
27
- } from ' apollo- server-plugin-base ' ;
28
+ } from ' @ apollo/ server' ;
28
29
import { GraphQLError } from ' graphql' ;
29
30
import {
30
31
fieldExtensionsEstimator ,
@@ -36,7 +37,7 @@ import {
36
37
export class ComplexityPlugin implements ApolloServerPlugin {
37
38
constructor (private gqlSchemaHost : GraphQLSchemaHost ) {}
38
39
39
- async requestDidStart(): Promise <GraphQLRequestListener > {
40
+ async requestDidStart(): Promise <GraphQLRequestListener < BaseContext > > {
40
41
const maxComplexity = 20 ;
41
42
const { schema } = this .gqlSchemaHost ;
42
43
You can’t perform that action at this time.
0 commit comments