graphql-compose / graphql-compose-mongoose

Mongoose model converter to GraphQL types with resolvers for graphql-compose https://github.com/nodkz/graphql-compose
MIT License
707 stars 94 forks source link

Are Subscriptions supported? #71

Open evangeloszotos opened 7 years ago

evangeloszotos commented 7 years ago

Hi,

I found your graphql-compose-* family, and consider it very useful. Really nice not having starting from scratch.

I am wondering if your graphql-compose-mongoose plugin supports subscriptions out of the box for mongoose models.

I found the GQC.rootSubscription() method, but did not see any example how to use it.

Many thanks in advance, best regards.

nodkz commented 7 years ago

Sorry for late response. I lost your issue. Nope, subscriptions are not supported out of the box.

If you have some thoughts how it can be implemented, please share your ideas.


How I understood for solving this task need to add some EventEmitter to this library. And it adds complexity to the codebase. In other side, records may be changed not only via graphql (eg. via some your server script which uses Mongoose models directly). So I think that it should be somehow implemented as a separate package.