-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Describe the bug
GitLab enforces a strict GraphQL complexity limit of 250 per query. The Decap CMS GitLab backend issues blob/tree GraphQL queries that can easily exceed this limit, causing failures when fetching large collections (e.g., many files, blobs, or merge requests). This breaks functionality for users with use_graphql: true
configurations and larger repositories.
This started happening between Oct 7th and 8th
To Reproduce
- Use a repository with a large number of files or blobs. (You are welcome to fork our GitLab repository - The Blog post collection calls the Author collection which is our biggest relational query)
- Set up Decap CMS with the GitLab backend and
use_graphql: true
in the configuration. This wasn't really reproducible locally (git-gateway/local backend enabled), so you will need to make sure you are working with the GitLab backend enabled. - Attempt to browse or fetch collections in the CMS (e.g., media library, file listings).
- Observe GraphQL queries failing due to "complexity limit exceeded" errors from GitLab.
Expected behavior
CMS should automatically paginate all collection queries and keep each page request under the complexity limit (with a safety margin). Large collections should load seamlessly, regardless of size, and maintain backward compatibility with existing configs.
Screenshots

Applicable Versions:
- Decap CMS version:
3.7.2
and3.8.4
- Git provider: GitLab
- OS: MacOS
- Browser version: Chrome 141
- Node.JS version: 22.16.0
CMS configuration
Additional context
(From CoPilot):
- GitLab started enforcing GraphQL complexity limits - docs
- This affects blob/tree queries the most, but any large collection query could break
- Proposed solution:implement automatic pagination for all GraphQL collection queries, keep each request under a safety margin (e.g., 200 complexity), and add retry logic to reduce page size if needed. Maintain full backwards compatibility for existing configs using
use_graphql: true
. - See Decap CMS GitLab backend code
- GitHub GraphQL API integration in Decap can be used as reference for Apollo usage and pagination patterns.