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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | graphql-3587412-4.patch | 4.31 KB | kingdutch |
Issue fork graphql-3587412
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
Comment #3
kingdutchComment #4
kingdutchAttaching a manual patch to unblock running this in testing. This matches PR 89 at time of writing.
Comment #5
kingdutchRelying 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.
Comment #8
klausiLooks good to me, thanks!