dotCMS / dotCMS/core

GraphQL: Internal Server Error when querying `blogContent` in a page

Open
#31,496 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OKR : Technical User Experience Priority : 3 Average Team : Scout Type : Defect
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

[!WARNING]
This issue only happens with STARTER DATA.
If you create a new contenttype and try to reproduce it, it will work as expected

Problem Statement

When querying a page that includes a Blog Content Type and attempting to retrieve the blogContent field (Block Editor), GraphQL throws an Internal Server Error instead of returning the expected data.

Steps to Reproduce

  1. Create a Regular Page in dotCMS.

  2. Add a Blog Content Type as a contentlet within a container on that page.

  3. Navigate to DevTools > GraphQL.

  4. Run the following GraphQL query:

    ``gql query page { page(url: "/example") { containers { identifier containerContentlets { uuid contentlets { ... on Blog { title blogContent { json } } } } } } } ``

  5. Observe that the query fails with an Internal Server Error.

Expected Behavior

  • The query should successfully return the blog content stored in the blogContent field without errors.
  • The response should correctly serialize the Block Editor content as JSON.

Acceptance Criteria

  • [ ] GraphQL should correctly resolve blogContent when queried within a page.
  • [ ] Ensure that blogContent properly serializes Block Editor content as JSON.
  • [ ] No Internal Server Error should occur when querying pages that contain Blog contentlets.
  • [ ] Add test cases for retrieving blogContent via GraphQL to prevent regressions.

dotCMS Version

Reproducible in: main / trunk / demo

Proposed Objective

Technical User Experience

Proposed Priority

Priority 3 - Average

Quality Assurance Notes & Workarounds

  • Temporary Workaround: If applicable, suggest an alternative way to fetch blogContent until the issue is resolved.
  • Verify the fix by testing the query on multiple pages containing Blog contentlets.

Sub-Tasks & Estimates

  • Investigate the root cause of the error.
  • Implement a fix for blogContent serialization in GraphQL.
  • Write unit tests to validate proper serialization and prevent future regressions.
  • Perform QA testing to confirm the fix works across different page configurations.

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 by reproducing the failure with the provided GraphQL page query against starter data, focusing on the Blog contentlet's blogContent field and its json value. Trace the GraphQL resolution and serialization path, then add regression coverage for retrieving blogContent through a page; done means the query returns JSON without an Internal Server Error across the described page configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.