Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
RmnRss opened this issue Jul 29, 2020 · 0 comments
Open
Labels
API Issues related to the community API (Strapi, databases, etc.) enhancement Issue related to the improvement of an existing feature help wanted Extra attention is needed

Comments

@RmnRss
Copy link
Member

RmnRss commented Jul 29, 2020

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.

@RmnRss RmnRss added enhancement Issue related to the improvement of an existing feature help wanted Extra attention is needed API Issues related to the community API (Strapi, databases, etc.) labels Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues related to the community API (Strapi, databases, etc.) enhancement Issue related to the improvement of an existing feature help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant