GraphQL: Internal Server Error when querying `blogContent` in a page
Nobody has claimed this yet.
- 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 newcontenttypeand 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
-
Create a Regular Page in dotCMS.
-
Add a Blog Content Type as a contentlet within a container on that page.
-
Navigate to DevTools > GraphQL.
-
Run the following GraphQL query:
``
gql query page { page(url: "/example") { containers { identifier containerContentlets { uuid contentlets { ... on Blog { title blogContent { json } } } } } } }`` -
Observe that the query fails with an Internal Server Error.
Expected Behavior
- The query should successfully return the blog content stored in the
blogContentfield without errors. - The response should correctly serialize the Block Editor content as JSON.
Acceptance Criteria
- [ ] GraphQL should correctly resolve
blogContentwhen queried within a page. - [ ] Ensure that
blogContentproperly serializes Block Editor content as JSON. - [ ] No Internal Server Error should occur when querying pages that contain Blog contentlets.
- [ ] Add test cases for retrieving
blogContentvia 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
blogContentuntil 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
blogContentserialization 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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