kratam
09/10/2018, 7:42 PMonConnect: (connectionParams: any, webSocket) => {
return {
foo: 'bar',
}
But the context
is undefined in the subscription resolver.catalinmiron
09/10/2018, 9:00 PMcatalinmiron
09/10/2018, 9:01 PMkratam
09/10/2018, 9:10 PMkratam
09/10/2018, 9:11 PMonConnect
method is called but the object I return from it is not showing up the the resolver, e.g.:
export const Subscription = {
newUsers: {
subscribe: (parent, args, ctx: Context, info: GraphQLResolveInfo) => {
console.log(parent, args, ctx)
return ctx.db.subscription.user({}, info)
},
},
}
ctx is always undefined
kratam
09/10/2018, 9:13 PMkratam
09/10/2018, 9:13 PMcatalinmiron
09/10/2018, 9:14 PMkratam
09/10/2018, 9:15 PMconnection.context
from the context:
method because onConnect
runs before the context: