-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
I have created a small example where the model is like the following
Student --- hasMany ---> Homework --- hasMany -----> Page
Now, when I load the following (note: viewer is the student) the there is one query for the student, one for the homework, but multiple for the pages. There are as many queries as there are pages. How can i optimize it so that there is only one query for the all the pages.
Best case scenario would be to load the whole thing at once, but i'd be happy for any pointers on how to optimize this.
{
viewer(id: 3) {
name
homeworks{
subject
pages{
content
}
}
}
}
The code i used to test this is available at https://gist.github.com/hardfire/3ff69d3a602bf3c30dcbbca71d67d605
Metadata
Metadata
Assignees
Labels
No labels