Skip to content

Content API browse() error "model layer expects using withRelated" when using include with filter #25775

@dash-

Description

@dash-

Issue Summary

Content API browse() method throws IncorrectUsageError when using include parameter with filter parameter in Ghost 6.0. The error message states "The model layer expects using withRelated", but withRelated is not a documented parameter for the Content API.

Steps to Reproduce

Steps to Reproduce

  1. Use Ghost Content API SDK v5.0 against hosted Ghost CMS
  2. Call posts.browse() with both filter and include parameters:
   const posts = await ghostContentAPI.posts.browse({
     filter: 'tag:some-tag',
     include: 'tags'
   })
  1. Error is thrown

Expected Behavior

According to the Ghost Content API documentation, the include parameter should work with the browse() method to include related resources like tags. This should work regardless of whether a filter parameter is used.

Actual Behavior

The API throws an IncorrectUsageError:

{
    "errors": [
        {
            "message": "Incorrect usage error, cannot list posts.",
            "context": "The model layer expects using `withRelated`.",
            "type": "IncorrectUsageError"
        }
    ]
}

Ghost Version

6.0 (hosted Ghost CMS - SaaS)

Node.js Version

Your version - I don't have visibility to hosted Ghost CMS environment

How did you install Ghost?

Hosted ghost CMS

Database type

MySQL 8 (I assume - again this is hosted Ghost CMS, I don't own this enviroment)

Browser & OS version

Chrome, MacOS 15.1.1

Relevant log / error output

{
    "errors": [
        {
            "message": "Incorrect usage error, cannot list posts.",
            "context": "The model layer expects using `withRelated`.",
            "type": "IncorrectUsageError"
        }
    ]
}

Code of Conduct

  • I agree to be friendly and polite to people in this repository

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs:triage[triage] this needs to be triaged by the Ghost team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions