Added form validation element to graphql.
Add Webform Element Validation Metadata to GraphQL Output
Summary
This PR enhances the graphql_compose_webform module by exposing validation-related properties for Webform elements in the GraphQL schema.
Changes
-
Added support for the following fields:
counter_typecounter_minimumcounter_maximumcounter_maximum_messagepatternpattern_errorrequiredrequired_erroruniqueunique_entityunique_userunique_error
-
These are resolved directly from the element render array.
Why?
This enables headless/front-end applications to apply consistent validation logic based on the Webform configuration in Drupal.
Testing
-
Create a webform with validation rules.
-
Query via GraphQL:
{ webform(id: "example_form") { elements { key counter_type counter_minimum counter_maximum counter_maximum_message pattern pattern_error required required_error unique unique_entity unique_user unique_error } } } -
Verify returned values match the Webform config.