From cbb14417529be63ea7df1785e2f32ed3a7ad56e5 Mon Sep 17 00:00:00 2001 From: Joseph Chan Date: Tue, 24 Jun 2025 08:47:36 -0400 Subject: [PATCH] Update subscriptions.mdx `useServer` should be imported from the path `graphql-ws/use/ws` instead of `graphql-ws/lib/use/ws`, starting from graphql versions 6.0.0 and up. see https://github.com/enisdenjo/graphql-ws/issues/617 --- docs/source/data/subscriptions.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/data/subscriptions.mdx b/docs/source/data/subscriptions.mdx index fdf492da976..76137513d4c 100644 --- a/docs/source/data/subscriptions.mdx +++ b/docs/source/data/subscriptions.mdx @@ -63,7 +63,7 @@ To run both an Express app _and_ a separate WebSocket server for subscriptions, import { ApolloServerPluginDrainHttpServer } from '@apollo/server/plugin/drainHttpServer'; import { makeExecutableSchema } from '@graphql-tools/schema'; import { WebSocketServer } from 'ws'; - import { useServer } from 'graphql-ws/lib/use/ws'; + import { useServer } from 'graphql-ws/use/ws'; ``` 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: