Closed tintin10q closed 3 years ago
We should definitely handle this internally but for now, as a workaround, you can do the following:
const server = new ApolloServer({
subscriptions,
typeDefs,
resolvers,
context: ({ req, connection }) => {
// If connection is set it means it's a websocket connection
if (connection) {
return connection.context;
}
return accountsGraphQL.context({ req });
}
});
This works fine thanks
I am keeping the issue open until a fix is merged :)
Yeah sorry I was also thinking that right after I closed it
Bug report
When I put context: accountsGraphQL.context in
new ApolloServer()
my subscriptions stop working. When I try to run a subscription I get the following error message in the consoleThe subscription stops lissenning and returns
If I don't put accountsGraphQL.context then there are no problems and the subscriptions work fine
To Reproduce
Make a apolloserver server working subscriptions Now add accountsGraphQL.context as the context like so
now you should be getting a lot of error messages.
Expected behavior
The subscriptions should just listen like normal
System information