Skip to content

Conversation

@meganelacheny
Copy link
Collaborator

  • Addition of an "Aggregation" section in main GraphQL API page
  • Addition on an aggregation example in GraphQL - Advanced Queries page

@meganelacheny meganelacheny self-assigned this Nov 13, 2025
@meganelacheny meganelacheny added pr: updated content PRs updating existing documentation content internal PRs created by the Strapi core team source: CMS labels Nov 13, 2025
@vercel
Copy link

vercel bot commented Nov 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
documentation Ready Ready Preview Comment Nov 18, 2025 10:55am

Copy link
Collaborator

@pwizla pwizla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a beautiful PR, Mégane, thank you! #chefkiss

The only minor comment I have is that I think the {#aggregations} part that follows the header on line 428 of graphql.md is unnecessary 😊

## My title {#my-custom-heading-title} is the format for custom heading ids that we sometime use when we want to manually define a precise heading link. This is useful for instance when we add badges to titles, to ensure the badge text is not part of the anchor link.

Here, since the ## Aggregations h2 and its custom heading {#aggregations} are strictly identical, I suggest we remove it; Docusaurus will properly generate a /cms/api/graphql#aggregations anchor automatically 🤓

:::
:::info Performance & limits
Aggregations operate server-side, so they are generally faster than downloading and processing large result sets on the client. However, complex `groupBy` trees and wide projections can still be expensive. Use filters to restrict the data set and consider enabling [query depth or amount limits](/cms/plugins/graphql#rate-limiting-and-query-depth) to protect your API. Errors such as `You are not allowed to perform this action` usually mean the requester lacks the `Read` permission on the target collection.
Copy link
Collaborator

@pwizla pwizla Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, and I've just noticed this 👀

Suggestion to replace the link by a sentence about depthLimit and amountLimit.

The rate-limiting-and-query-depth section does not exist in our docs 😅 causing the build to fail (broken anchor link)

Suggested change
Aggregations operate server-side, so they are generally faster than downloading and processing large result sets on the client. However, complex `groupBy` trees and wide projections can still be expensive. Use filters to restrict the data set and consider enabling [query depth or amount limits](/cms/plugins/graphql#rate-limiting-and-query-depth) to protect your API. Errors such as `You are not allowed to perform this action` usually mean the requester lacks the `Read` permission on the target collection.
Aggregations operate server-side, so they are generally faster than downloading and processing large result sets on the client. However, complex `groupBy` trees and wide projections can still be expensive. Use filters to restrict the data set and consider setting up `depthLimit` and `amountLimit` values accordingly (see [#available-options](#available-options)) to protect your API. Errors such as `You are not allowed to perform this action` usually mean the requester lacks the `Read` permission on the target collection.

Information from Kapa since I didn't know whether we had query limiting options for GQL in Strapi 😅
Screenshot 2025-11-14 at 11 48 05

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah oops, well spotted 🙈 Thank you for the proposition to fix that mistake!

@pwizla pwizla added this to the 6.11.1 milestone Nov 18, 2025
@pwizla pwizla merged commit baf1eef into main Nov 19, 2025
4 checks passed
@pwizla pwizla deleted the cms/graphql-aggregation branch November 19, 2025 13:32
pwizla added a commit that referenced this pull request Nov 19, 2025
* Add aggregations section in GraphQL API docs

* Add section in GraphQL advanced queries

* Fix mistakes

* Fix inexistent anchor link/wrong page link

---------

Co-authored-by: Pierre Wizla <pwizla+github@gmail.com>
pwizla added a commit that referenced this pull request Nov 19, 2025
* Add aggregations section in GraphQL API docs

* Add section in GraphQL advanced queries

* Fix mistakes

* Fix inexistent anchor link/wrong page link

---------

Co-authored-by: meganelacheny <megane.lacheny@strapi.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal PRs created by the Strapi core team pr: updated content PRs updating existing documentation content source: CMS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants