graphql-mongodb-server
graphql-mongodb-server copied to clipboard
Updating user Posts array when createPost
Hey man, thanks for the awesome thing you've built!
I got your server running and connected, but when I create a Post it's not added to the User's array of posts.
What was your solution to it?
I'm trying to add on my logic on top and if I get it working I'll create a pull request.
Cheers 💪
I think this is already implemented no? When you create a Post, you must add an Author and this Author is an _id referencing to a specific User. I'll run it later and see if it's working, but I'd really recommend you to open a PR. I think that the same could be done for the Comments, if you add a Comment it should be attached to Post.
Does your version work for you?
I made a pull request with my fixes, please check them for the sense of code consistency. I'm gonna try to do the same now with comments 👌