Skip to content

Commit 32203b0

Browse files
authoredDec 20, 2024
Merge pull request #3169 from kasir-barati/master
chore: remove deprecated import
2 parents 23b317d + d050ac8 commit 32203b0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎content/graphql/complexity.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ $ npm install --save graphql-query-complexity
1919
Once 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';
2424
import {
2525
ApolloServerPlugin,
26+
BaseContext,
2627
GraphQLRequestListener,
27-
} from 'apollo-server-plugin-base';
28+
} from '@apollo/server';
2829
import { GraphQLError } from 'graphql';
2930
import {
3031
fieldExtensionsEstimator,
@@ -36,7 +37,7 @@ import {
3637
export 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

0 commit comments

Comments
 (0)
Please sign in to comment.