Skip to content

Create a custom query to count the number of medias inside a section #11

@RmnRss

Description

@RmnRss

Strapi not having a real implementation of count using GraphQL I used a workaround to count the number of media inside a library section. I am currently fetching all media ids inside a library section and then get the length of the array containing them.

But the best practice would be to create a custom query returning the library section with a count of the library media as an attribute.

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIIssues related to the community API (Strapi, databases, etc.)enhancementIssue related to the improvement of an existing featurehelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions