Problem/Motivation

The graphql.buffer.entity_preview service depends on node_preview which is defined in the Node module. This means that if a GraphQL API tries to load the graphql.buffer.entity_preview service but does not have the node module enabled, the site will crash.

This set-up is common in tests where API functionality without nodes may be tested. However, since the GraphQL module is a tool for power-users it's also likely to be used in more complex scenarios where data may not be stored in nodes but in other or custom entities and the node module may not be available.

This was introduced in #3563846: Support node preview URLs in route_entity and entity_reference_revisions and not caught by tests because they use Node for the entity in the test.

The node module should not be a dependency for the use of the GraphQL module.

Steps to reproduce

Proposed resolution

Properly go through the paramconverter_manager service which is in Core and load the parameter converter for the entity being previewed, handling the case where it may be unavailable.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#4 graphql-3587412-4.patch4.31 KBkingdutch

Issue fork graphql-3587412

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

kingdutch created an issue. See original summary.

kingdutch’s picture

Status: Active » Needs review
kingdutch’s picture

StatusFileSize
new4.31 KB

Attaching a manual patch to unblock running this in testing. This matches PR 89 at time of writing.

kingdutch’s picture

Version: 5.0.0-beta3 » 5.x-dev
Status: Needs review » Fixed

Relying on test coverage so that it can be included in GraphQL 5 beta4. If there are review comments they can be addressed in between beta and stable release.

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.

  • kingdutch committed 66f16b29 on 5.x
    fix: #3587412 Entity preview buffer should not rely on node module
    
klausi’s picture

Looks good to me, thanks!