entity_url producer in preview returns error

Created on 3 February 2025, 21 days ago

Problem/Motivation

Any `entity_url` produced on a content entity that is new (no id) will result in an error.

entity cannot have a URI as it does not have an ID

Steps to reproduce

{
  route(path: "/node/preview/9c1802b2-3840-4ba3-94f6-8b042db89bf2/full") {
    ... on RouteInternal {
      entity {
        ... on NodeInterface {
          path
        }
      }
    }
  }
}

Proposed resolution

  1. PathItem: Add conditional check for isNew on entity before generating path.
  2. LanguageSchemaExtension: Add conditional check for isNew on entity before generating path.

Remaining tasks

Write tests

User interface changes

None

API changes

YES: Drupal\graphql_compose\Plugin\GraphQLCompose\FieldType is forced to not be required.

Data model changes

YES: All entity path fields are no longer required. String

🐛 Bug report
Status

Active

Version

2.3

Component

Code

Created by

🇦🇺Australia almunnings Melbourne, 🇦🇺

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024