Closed (fixed)
Project:
GraphQL
Version:
5.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 May 2025 at 09:35 UTC
Updated:
13 May 2026 at 16:05 UTC
Jump to comment: Most recent
The EntityUrl DataProducer in the GraphQL module assumes that the entity passed to it is always valid and has an ID. However, in some cases (like when using the same page preview on newly created nodes), this assumption can lead to an exception.
This patch adds a safeguard to the resolve() method of EntityUrl to return null if the passed entity does not have an ID.
| Comment | File | Size | Author |
|---|---|---|---|
| preview_with_new_nodes_graphql.patch | 614 bytes | britt.vdl |
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 #2
kingdutchWe should use `isNew` which achieves the same but has a clearer intention. Moving version to latest version.
Comment #4
kingdutchComment #5
klausiThanks, approach looks good to me. Please add a test case.
Comment #6
kingdutchComment #7
kingdutch