Expose the element metadata directly in nested elements

Created on 12 February 2025, 4 months ago

Problem/Motivation

Now that Move properties on the WebformElement interface Active is in we can remove 1 level of nesting by directly exposing WebformElementMetadata on the child elements rather than exposing WebformElement which has become just a wrapper intended to slim down the schema.

Steps to reproduce

Now child elements are accessed through the elements -> metadata path:

fragment fieldsets on WebformElementFieldset {
  elements {
    metadata { # <<<<< Here
      key
      title
    }
  }
}

query webform($id: String!) {
  form: webformById(id: $id) {
    title
    elements {
      ...fieldsets
    }
  }
}

Proposed resolution

We can omit the metadata field and access child element metadata directly through elements:

fragment fieldsets on WebformElementFieldset {
  elements {
    key
    title
  }
}

query webform($id: String!) {
  form: webformById(id: $id) {
    title
    elements {
      ...fieldsets
    }
  }
}
Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇧🇬Bulgaria pfrenssen Sofia

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