-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Hi,
Thanks for this project that simplifies the burden on how to setup subscription. My issue is that it relies on subscriptions-transport-ws which is deprecated to the benefit of https://the-guild.dev/blog/graphql-over-websockets as mentioned on their npm page:
The subscriptions-transport-ws library is not being actively maintained. It is recommended that you use the graphql-ws library instead. For details read the GraphQL over WebSockets announcement.
So I'm struggling about how to get the roots of my gql schema from the object returned by schemaComposer.buildSchema()
subscriptionServer.js
import ws from 'ws'; // yarn add ws
import { useServer } from 'graphql-ws/lib/use/ws';
const GraphQlSchema = require('./graphql').default
//redis must be running
const server = new ws.Server({
port: 4001,
path: '/subscribe',
});
useServer(
// from the previous step
{ schema: GraphQlSchema, roots: GraphQlSchema },
server
);
console.log('Listening to port 4001');
Metadata
Metadata
Assignees
Labels
No labels