Skip to content

Commit 1767abb

Browse files
Update plugins.md
1 parent df335cc commit 1767abb

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

content/graphql/plugins.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ Plugins enable you to extend Apollo Server's core functionality by performing cu
66

77
#### Custom plugins
88

9-
To create a plugin, declare a class annotated with the `@Plugin` decorator exported from the `@nestjs/apollo` package. Also, for better code autocompletion, implement the `ApolloServerPlugin` interface from the `apollo-server-plugin-base` package.
9+
To create a plugin, declare a class annotated with the `@Plugin` decorator exported from the `@nestjs/apollo` package. Also, for better code autocompletion, implement the `ApolloServerPlugin` interface from the `@apollo/server` package.
1010

1111
```typescript
12+
import { ApolloServerPlugin, GraphQLRequestListener } from '@apollo/server';
1213
import { Plugin } from '@nestjs/apollo';
13-
import {
14-
ApolloServerPlugin,
15-
GraphQLRequestListener,
16-
} from 'apollo-server-plugin-base';
1714

1815
@Plugin()
1916
export class LoggingPlugin implements ApolloServerPlugin {
20-
async requestDidStart(): Promise<GraphQLRequestListener> {
17+
async requestDidStart(): Promise<GraphQLRequestListener<any>> {
2118
console.log('Request started');
2219
return {
2320
async willSendResponse() {
@@ -50,4 +47,4 @@ GraphQLModule.forRoot({
5047
}),
5148
```
5249

53-
> info **Hint** The `ApolloServerOperationRegistry` plugin is exported from the `apollo-server-plugin-operation-registry` package.
50+
> info **Hint** The `ApolloServerOperationRegistry` plugin is exported from the `@apollo/server-plugin-operation-registry` package.

0 commit comments

Comments
 (0)