graphql-mongodb-server icon indicating copy to clipboard operation
graphql-mongodb-server copied to clipboard

Updating user Posts array when createPost

Open durdevic opened this issue 5 years ago • 2 comments

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 💪

durdevic avatar Mar 08 '19 10:03 durdevic

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.

leonardomso avatar Mar 08 '19 11:03 leonardomso

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 👌

durdevic avatar Mar 08 '19 14:03 durdevic