Closed ubbop42 closed 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!
SubscriptionServer
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 },
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 },