fullstack-graphql-airbnb-clone
fullstack-graphql-airbnb-clone copied to clipboard
How many dataloaders do we need ?
Hey, do you create 1 loader for each type of entity and that's enough? no need for separate loaders for subqueries? So if you query
{Article (where: {id: 1})
{
Comments { id }
}
}
, if you have a CommentLoader that will load as only 2 SQL calls?
Or do we need a CommentByArticleLoader to only be used with this query?
You'll sometimes need to create separate loaders for subqueries
in this case I would do CommentByArticleLoader