Quantcast
Channel: Active questions tagged feed - Stack Overflow
Viewing all articles
Browse latest Browse all 547

Generate a feed from followed users items with GraphQL (nestjs)

$
0
0

I'm new to graphql, I have some users that can follow each other and they have a list of products, what would be the way to go to create a feed of products of the users you follow?

The user has a property called listing that has a relation to the products (which has a relation to the user with a property called author)

Basically the user looks like this:

User object{  ...  listing: [ "id1", "id2" ]}

and the product like this:

Product object{  ...  author: { User1 }}

what would be the best approach to write a query to get the products from the followed users?

other maybe useful information:

  • the data is stored in a mongodb database
  • the listings and the author are stored as ids but can be populated with the full object

thanks!


Viewing all articles
Browse latest Browse all 547

Trending Articles