dotCMS / dotCMS/core

Allow PageAPI + GraphQL PageAPI take a content query

Open
#32,234 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Roadmap Team : Scout Type : New Functionality
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

User Story

Right now, our page APIs require a user to pass a url in order to render a page. It would be great if a user could pass a lucene query to pull a page (or pages). If multiple pages are returned, we would return an array of page responses.

OR
If you are pulling back pageAssets/slugs when returning content, we could allow the layout properties to be accessed.

Anyway - it seems like we were right initially calling the page API "Layout as a Service" - headless customers often don't want pages, they want to use a pages layout to be pulled into another page as just a component. Having to query for that by URL can get messy/confusing.

Something like:

        page(query: "+path:/about-us/* languageId:1 +site:demo.dotcms.com", limit:10, offset:0, sortBy: "modDate desc") {
            _map
            urlContentMap {
                identifier
                modDate
                publishDate
                creationDate
                title
                baseType
                inode
               }
            layout {
                header
                footer
                body {
                    rows {
                        columns {
Acceptance Criteria
  1. Allow page responses to be delivered using a query and not just a url
  2. Allow multiple page responses to come back if multiple pages are requested.
Proposed Objective

Please Select

Proposed Priority

Please Select

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

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 tracing the PageAPI and GraphQL PageAPI entry points and how they currently accept a URL. Define how a Lucene content query, limit, offset, and sort should produce one or multiple page responses, then verify the implementation against the two acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, java
Domain
api, backend-api-design, search
Issue type
Feature
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.