Remove Metadata subfields

Created on 5 September 2024, 4 months ago
Updated 17 September 2024, 3 months ago

Problem/Motivation

While migrating a website from GraphQL 3, I noticed the new "metadata" property which raises the following issues:

  • In my case, the data is consumed by a Vue application where I would need to rewrite and re-map the field data or flat them in the code or at the GraphQ fragment level
  • The "metadata" property also contains field data and not only metadata information, which is not consistent
  • In general, for easier migration from GraphQL 3, it would be better to keep a flat structure

Proposed resolution

Remove the "metadata" property and bring back all the child properties to the root.

User interface changes

None

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

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

Merge Requests

Comments & Activities

  • Issue created by @ralf57
  • First commit to issue fork.
  • 🇧🇬Bulgaria pfrenssen Sofia

    This is a great suggestion. I introduced the metadata field early on when I started the port to GraphQL 4 because I was concerned about potential key collisions. But indeed this is making the migration from GraphQL 3 to GraphQL 4 more difficult than strictly needed.

    I will have a look if this can be easily reverted to the original layout as used previously.

    If we change this back this will be a B/C break but I think this is OK since we are still in early alpha.

  • Merge request !39Move all metadata in the WebformElement root. → (Merged) created by pfrenssen
  • 🇧🇬Bulgaria pfrenssen Sofia

    I added an MR that moves the metadata fields in the root. There were 2 collisions:

    1. WebformElementMetadata.required is conflicting with WebformElement.required. This has been solved by keeping the WebformElement.required field and its corresponding type WebformRequiredElement. The fields WebformElementMetadata.required and WebformElementMetadata.requiredError are removed. This best aligns with the how it was done previously in the 8.x-1.x branch.
    2. WebformElementMetadata.multiple is conflicting with WebformElement.multiple. This has been solved by renaming WebformElement.multiple to WebformElement.multipleValues so that it matches the type name WebformElementMultipleValuesBase.
  • Status changed to RTBC 4 months ago
  • Status changed to Fixed 3 months ago
  • Status changed to RTBC 3 months ago
  • Pipeline finished with Skipped
    3 months ago
    #285289
    • pfrenssen committed 164e3cc9 on 2.x
      Issue #3472252 by pfrenssen, ralf57, hazn: Remove Metadata subfields
      
  • Status changed to Fixed 3 months ago
  • 🇧🇬Bulgaria pfrenssen Sofia

    Thanks for testing! Merged in 2.x.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024