Reference fields are always Unions of everything

Created on 24 January 2025, 2 days ago

Problem/Motivation

When I for example have a reference paragraph field with unlimited amount of items it creates a ParagraphUnion field, I get that but in Drupal we have the option to select what paragraphs we want for that field. Wouldn't it be better if we create separate unions based on the allowed paragraphs/content types/terms for that certain field? This would make our schema more type-safe. And creating separate unions for each field could make the schema more explicit about what types are allowed in each field. This could be helpful for frontend developers consuming the API.

I get that the schema would become more complex and maybe therefor this way of creating Unions is chosen. But might be something to look into.

✨ Feature request
Status

Active

Version

2.3

Component

Code

Created by

πŸ‡§πŸ‡ͺBelgium cedricl

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

Comments & Activities

Production build 0.71.5 2024