Skip to content

[Bug]: GraphQL aggregate field missing from connection types despite documentation #3157

@MarsKong123

Description

@MarsKong123

Link to the documentation page or resource

https://docs.strapi.io/cms/api/graphql#aggregations

Describe the bug

According to the official Strapi documentation, connection types in the GraphQL API (such as doctors_connection) should include aggregate field for aggregation queries. However, after installing the latest Strapi core and @strapi/plugin-graphql (v5.43.0), this field is missing from the generated GraphQL schema.

I have set v4CompatibilityMode to false in plugins.ts and restarted the server, but the aggregate field still DO NOT appear in the schema introspection results.

This issue makes it impossible to perform aggregation queries as described in the documentation.

Please clarify whether this is a documentation error, a missing feature, or if there are additional steps required to enable these fields.

My GraphQL query:

query {
    doctors_connection {
        aggregate {
            count
        }
    }
}

The error message i got:

{
    "errors": [
        {
            "message": "Cannot query field \"aggregate\" on type \"DoctorEntityResponseCollection\".",
            "locations": [
                {
                    "line": 3,
                    "column": 9
                }
            ],
            "extensions": {
                "code": "GRAPHQL_VALIDATION_FAILED",
                "stacktrace": [
                    ...
                ]
            }
        }
    ]
}

Additional context

No response

Suggested improvements or fixes

No response

Related issue(s)/PR(s)

No response

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions