When getting multiple studysets, like in a list for the dashboard, if we want to get the saved status of the studyset so we could display it and give an option/button to change it in the dropdown, we would be doing N+1 queries because the resolver for the saved field of a studyset type has it's own database query. To avoid N+1 queries, we should use a dataloader instead.
Right now, we just do not fetch the saved field under studysets when we get multiple studysets. So in the dashboard for example, there is no save/unsave option in the dropdown for the studyset list. You can only save/unsave when you go to a single studyset's page, cause then it queries saved just once for that studyset.
The saved studysets section has a unsave option in the dropdown, but that's because we know anything returned by the saved studysets query is saved, so we're still not actually using the saved field for that either.
When getting multiple studysets, like in a list for the dashboard, if we want to get the
savedstatus of the studyset so we could display it and give an option/button to change it in the dropdown, we would be doing N+1 queries because the resolver for the saved field of a studyset type has it's own database query. To avoid N+1 queries, we should use a dataloader instead.Right now, we just do not fetch the
savedfield under studysets when we get multiple studysets. So in the dashboard for example, there is no save/unsave option in the dropdown for the studyset list. You can only save/unsave when you go to a single studyset's page, cause then it queriessavedjust once for that studyset.The saved studysets section has a unsave option in the dropdown, but that's because we know anything returned by the saved studysets query is saved, so we're still not actually using the saved field for that either.