File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 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
1919Once the installation process is complete, we can define the ` ComplexityPlugin ` class:
2020
2121``` 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' ;
2424import {
2525 ApolloServerPlugin ,
26+ BaseContext ,
2627 GraphQLRequestListener ,
27- } from ' apollo- server-plugin-base ' ;
28+ } from ' @ apollo/ server' ;
2829import { GraphQLError } from ' graphql' ;
2930import {
3031 fieldExtensionsEstimator ,
@@ -36,7 +37,7 @@ import {
3637export class ComplexityPlugin implements ApolloServerPlugin {
3738 constructor (private gqlSchemaHost : GraphQLSchemaHost ) {}
3839
39- async requestDidStart(): Promise <GraphQLRequestListener > {
40+ async requestDidStart(): Promise <GraphQLRequestListener < BaseContext > > {
4041 const maxComplexity = 20 ;
4142 const { schema } = this .gqlSchemaHost ;
4243
You can’t perform that action at this time.
0 commit comments