Skip to content

Commit 17bf863

Browse files
authored
Merge pull request #8150 from apollographql/gigi/dxm-247-update-useserver
[dxm-247] 'graphql-ws/lib/use/ws' -> 'graphql-ws/use/ws'
2 parents 265dda9 + fa08436 commit 17bf863

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/source/data/subscriptions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ To run both an Express app _and_ a separate WebSocket server for subscriptions,
6767
import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer';
6868
import { makeExecutableSchema } from '@graphql-tools/schema';
6969
import { WebSocketServer } from 'ws';
70-
import { useServer } from 'graphql-ws/lib/use/ws';
70+
import { useServer } from 'graphql-ws/use/ws';
7171
```
7272

7373
3. Next, in order to set up both the HTTP and subscription servers, we need to first create an `http.Server`. Do this by passing your Express `app` to the `createServer` function, which we imported from the `http` module:
@@ -149,7 +149,7 @@ import { createServer } from 'http';
149149
import express from 'express';
150150
import { makeExecutableSchema } from '@graphql-tools/schema';
151151
import { WebSocketServer } from 'ws';
152-
import { useServer } from 'graphql-ws/lib/use/ws';
152+
import { useServer } from 'graphql-ws/use/ws';
153153
import cors from 'cors';
154154
import resolvers from './resolvers';
155155
import typeDefs from './typeDefs';

0 commit comments

Comments
 (0)