Skip to content

GraphQL: Block Editor field for urlContentMap is a JSON String instead of an object #31921

Closed
@zJaaal

Description

@zJaaal

Problem Statement

When fetching a page with urlContentMap that contains a Block Editor using the GraphQL API (/api/v1/graphql). It retrieves two fields for that value:

  1. myBlockEditorField -> Object
  2. myBlockEditorField_raw -> JSON String

The issue is that, on GraphQL the first field is coming as a JSON String instead of an object. In the REST API, the first one is an Object.

Steps to Reproduce

  1. Go to GQL Playground on demo
  2. Use the following query (Please be sure that this page exists and is a urlContentMap with a Block Editor)
fragment DotCMSPage on DotPage {
  urlContentMap {
    _map
  }
}
query PageContent {
  page: page(url: "/blog/post/french-polynesia-everything-you-need-to-know") {
    ...DotCMSPage
  }
}
  1. Look for blogContent and blogContent_raw both of them will be strings but the first one should be an object.

You can check here the REST version of this page

Acceptance Criteria

  • The values should be homologated to work as they do on the REST API

dotCMS Version

trunk-latest

Proposed Objective

Technical User Experience

Proposed Priority

Priority 3 - Average

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions