Skip to content

Bug: Decap GitLab backend is hitting GitLab GraphQL complexity limits #7627

@meganfilo

Description

@meganfilo

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

  1. 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)
  2. 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.
  3. Attempt to browse or fetch collections in the CMS (e.g., media library, file listings).
  4. 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

Ex:
Image

Image

Applicable Versions:

  • Decap CMS version: 3.7.2 and 3.8.4
  • Git provider: GitLab
  • OS: MacOS
  • Browser version: Chrome 141
  • Node.JS version: 22.16.0

CMS configuration

https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/public/admin/blog/config.yml

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions