Skip to content

Preview: get "parent" post ID for non-hierarchical posts when using asPreview #2876

Description

@renatonascalves

What problem does this address?

Currently, if you try to preview a non-hierarchical post, the Previewable interface does not return the post ID of the "parent" post.

Screenshot 2023-08-01 at 11 22 50

What is your proposed solution?

There are a few options here:

  • We could add a new field for the Previewable interface, exposing the "parent" post ID;
  • We could add a new custom interface for non-hierarchical posts exposing the "parent" post ID;
  • We could let API consumers to figure this out by themselves.

What alternatives have you considered?

Currently, API consumers need to circumvent this by getting the id in the params and swap for the one in the response in their apps.

But it is my understanding tools are not doing that and exposing a broken experience. (See the additional context below).

Additional Context

This is particularly helpful in a toolbar. See this Github issue, wpengine/faustjs#1515, for an example where this problem reflects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: connectionsRelating to GraphQL Connectionseffort: lowAround a day or lesshas: workaroundA temporary workaround has been providedimpact: medMinor performance improvements, fix broad user base issuesstatus: actionableReady for work to begintype: enhancementImprovements to existing functionality

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions