dotCMS / dotCMS/core

[DEFECT] SDK: Page Query Override Breaks Contentlet Data When Extending Page Response

Open
#33,729 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

dotCMS : SDK OKR : Customer Support Team : Scout
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Problem Statement

When developers pass a custom page GraphQL fragment to extend the page response (e.g. to fetch relationships like author { firstName }), the SDK currently disables _map for contentlets unless manually re-added.

This causes missing contentlet fields in the UI and forces developers to reconstruct internal query fragments.

This behavior was intentional originally (full override mode), but real usage shows most developers only want to extend the response; not replace core fields.

We need to evaluate the best long-term solution.

Steps to Reproduce

If you try this request:

dotCMSClient.page.get(path, {
  graphql: {
    page: `
      urlContentMap {
        ... on Blog {
          author {
            firstName
          }
        }
      }
    `
  }
});

Your page will be broken; to fix it to need to do:

page: `
  containers {
    containerContentlets {
      contentlets { _map }
    }
  }
  urlContentMap {
    ... on Blog {
      author { firstName }
    }
  }
`
Video

https://github.com/user-attachments/assets/5ed71424-0a9f-484b-8da1-4ca6c1a383fa

Acceptance Criteria

Acceptance Criteria for Spike

  • Written proposal with recommended approach
  • Code experiment or prototype (if needed)
  • Impact analysis (DX, backwards compatibility, performance)
  • Next steps: implement ticket OR technical design doc
dotCMS Version

@dotcms/client@latest

Severity

Medium - Some functionality impacted

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dotCMSClient.page.get reproduction and compare the custom page GraphQL fragment with the version that explicitly includes containers, containerContentlets, contentlets, and _map. Assess the behavior's DX, backwards-compatibility, and performance impact, then document a recommended approach, prototype if needed, and next steps as requested by the spike acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, typescript
Domain
api, developer-experience
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.