Problem/Motivation

The route_entity and entity_reference_revisions data producers do not support node preview URLs. This patch updates route-entity resolution and entity reference handling to correctly resolve unpublished or previewable content while maintaining proper cache handling.

  • route_entity does not account for preview-specific route parameters, preventing queries of unpublished or preview nodes.
  • entity_reference_revisions does not resolve revisions correctly when accessed via preview URLs.

This limits editors on sites with decoupled frontends from previewing content through GraphQL.

Steps to reproduce

  1. Configure a schema using EntityReferenceRevisions.
  2. Query a node via a preview URL.
  3. Verify the entity and its references are correctly returned.
  4. Confirm caching behaves as expected without exposing unpublished content inappropriately.

Proposed resolution

  • Updated RouteEntity to handle preview route parameters.
  • Modified EntityReferenceRevisions to correctly resolve revisions for preview URLs.
  • Added EntityPreviewBuffer to allow facilitating NodePreviewConverter param converter for loading from tempstore.

Issue fork graphql-3563846

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

volkerk created an issue. See original summary.

klausi’s picture

Status: Active » Needs work
Issue tags: +Needs tests
volkerk’s picture

Status: Needs work » Needs review

@klausi Thanks for the review! Addressed the comments and added some tests.

  • klausi committed 3519bdc8 on 5.x authored by volkerk
    feat(entity_reference_revisions): Support node preview URLs in...
klausi’s picture

Status: Needs review » Fixed

Merged, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

klausi’s picture

Unfortunately this has caused an access by pass issue. Since GraphQL 5 is not stable yet we don't need to do a security release.

Fixed in #3586684: Access check missing for entity_reference_revisions data producer.