Skip to content

Commit

Permalink
Merge pull request #3169 from kasir-barati/master
Browse files Browse the repository at this point in the history
chore: remove deprecated import
  • Loading branch information
kamilmysliwiec authored Dec 20, 2024
2 parents 23b317d + d050ac8 commit 32203b0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions content/graphql/complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -36,7 +37,7 @@ import {
export class ComplexityPlugin implements ApolloServerPlugin {
constructor(private gqlSchemaHost: GraphQLSchemaHost) {}

async requestDidStart(): Promise<GraphQLRequestListener> {
async requestDidStart(): Promise<GraphQLRequestListener<BaseContext>> {
const maxComplexity = 20;
const { schema } = this.gqlSchemaHost;

Expand Down

0 comments on commit 32203b0

Please sign in to comment.