graphql-modules icon indicating copy to clipboard operation
graphql-modules copied to clipboard

Per-message ProviderScope for Websockets

Open darkbasic opened this issue 5 years ago • 0 comments

It looks like ProviderScope.Session is kept on memory for the whole ws life, while instead I need to create a new instance on each ws message in order to be able to use Mikro-ORM with graphql-modules and ws transport: https://github.com/accounts-js/accounts/pull/1003#issuecomment-651710092

I'm creating an Accounts.js adapter for Mikro-ORM and I would like to share the same EntityManager provider (which takes care of forking it on each network request/ws message) with the Accounts.js authentication module, so that the Identity Map gets shared.

Is there anything graphql-modules provides in order to restric the lifespan to ws messages when using a ws transport?

darkbasic avatar Jun 30 '20 10:06 darkbasic