Skip to content

Dataloader for saved status on studyset #35

Description

@ehanahamed

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions