apollographql / graphql-subscriptions

:newspaper: A small module that implements GraphQL subscriptions for Node.js
MIT License
1.59k stars 133 forks source link

Missing schema information. #180

Closed ubbop42 closed 5 years ago

ubbop42 commented 5 years ago

Missing schema information. The GraphQL schema should be provided either statically in the SubscriptionServer constructor or as a property on the object returned from onOperation!

new SubscriptionServer({ schema, execute, subscribe, onConnect: connectionParams => { if (connectionParams.Authorization) { const authorization = connectionParams.Authorization const token = authorization ? authorization.split(' ')[1] : '' const env = PROD_ENV const loaders = createLoaders(token, env) return { token, loaders, env, } } throw new Error('Missing auth token!') }, onOperation: (msg, params, socket) => { console.log(msg) return msg },