From d050ac817bc06206f631cad4622eab841e01a587 Mon Sep 17 00:00:00 2001 From: Kasir Barati Date: Wed, 18 Dec 2024 16:06:22 +0100 Subject: [PATCH] chore: remove deprecated import --- content/graphql/complexity.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/content/graphql/complexity.md b/content/graphql/complexity.md index 2bb7678444..9de8f5ce75 100644 --- a/content/graphql/complexity.md +++ b/content/graphql/complexity.md @@ -19,12 +19,13 @@ $ npm install --save graphql-query-complexity Once the installation process is complete, we can define the `ComplexityPlugin` class: ```typescript -import { GraphQLSchemaHost } from "@nestjs/graphql"; -import { Plugin } from "@nestjs/apollo"; +import { GraphQLSchemaHost } from '@nestjs/graphql'; +import { Plugin } from '@nestjs/apollo'; import { ApolloServerPlugin, + BaseContext, GraphQLRequestListener, -} from 'apollo-server-plugin-base'; +} from '@apollo/server'; import { GraphQLError } from 'graphql'; import { fieldExtensionsEstimator, @@ -36,7 +37,7 @@ import { export class ComplexityPlugin implements ApolloServerPlugin { constructor(private gqlSchemaHost: GraphQLSchemaHost) {} - async requestDidStart(): Promise { + async requestDidStart(): Promise> { const maxComplexity = 20; const { schema } = this.gqlSchemaHost;