When designing relationships, we typically link documents via ObjectId, rather than embedding entire objects. However, when consuming the API, we construct nested queries and expect GraphQL to connect any related models behind the scenes. The mapping from ObjectId reference to the underlying Mongoose model is something that needs to be orchestrated in resolvers, since the default behavior of returning the parent fields would not suffice. We are going to take a closer look at those today.
Besides, we will also revisit validation briefly. With this video, we should be able to initiate chats in the app. Next up, we will work on sending messages. There are a few spots in GraphQL where we left out user privacy. Did you spot those? We'll address them in the upcoming episode.
Mongoose Populate https://mongoosejs.com/docs/populate....
Populate with Promises https://github.com/Automattic/mongoos...
Смотрите видео MERN Stack & GraphQL - #15 Query Population онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code Realm 25 Январь 2019, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,42 раз и оно понравилось 13 людям.