Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Introduce subscription resolvers using Mongoose Watch #410

Open
nodkz opened this issue Jun 28, 2022 · 0 comments
Open

feat: Introduce subscription resolvers using Mongoose Watch #410

nodkz opened this issue Jun 28, 2022 · 0 comments

Comments

@nodkz
Copy link
Member

nodkz commented Jun 28, 2022

Can we made it into the core of this tool by using Mongoose Watch

Something like this

UserMD.watch().on("change", (data) => {
    if (data.operationType === "insert") {
      console.log("User inserted: ", data.fullDocument);
    }
  
    if (data.operationType === "replace") {
      console.log("User updated: ", data.fullDocument);
    }
  
    if (data.operationType === "delete") {
      // Like here the user was deleted so it's time to detelet his or her information from all the groups.
      console.log("User deleted: ", data._id);
    }
 });

This is the most common Mongo DB and GraphQL issue so if this tool solve it like it solved the query long time making then this tool will get a boost up.

Originally posted by @maheraldous in #409 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant