Drupal is a registered trademark of Dries Buytaert
cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)!

Exposes entity form mode field definitions and structure via GraphQL for headless applications.

Requirements

Schema Extension

Adds the entityFormMode field to the Query root type:

extend type Query {
  entityFormMode(
    entity_type: EntityType!
    entity_bundle: String!
    entity_id: String
    operation: Operation
  ): EntityFormModeResponse
}

Response Type

type EntityFormModeResponse implements Response {
  success: Boolean
  errors: [Violation]
  form: Json
  form_mode_fields: Json
  form_mode_field_groups: Json
}

Query Example

Retrieve form fields for a node bundle (create operation)

query GetNodeFormFields {
  entityFormMode(
    entity_type: NODE
    entity_bundle: article
    operation: CREATE
  ) {
    success
    errors {
      message
    }
    form_mode_fields {
      machine_name
      type
      required
      weight
      settings {
        cardinality
        type
      }
      widget {
        #type
        #title
        #description
        #required
      }
      existing_values
    }
    form_mode_field_groups {
      machine_name
      label
      format_type
      parent_field_group
      children
      weight
    }
  }
}

Retrieve form with pre-filled values (update operation)

query GetNodeFormFields {
  entityFormMode(
    entity_type: NODE
    entity_bundle: article
    entity_id: "123"
    operation: UPDATE
  ) {
    success
    form_mode_fields {
      machine_name
      existing_values
    }
  }
}

Permission Handling

Access control uses graphql_compose_mutations.user_permissions service:

  • Validates user permissions via userCanDoActionOnEntityByType()
  • Administrators (uid=1 or 'administrator' role) bypass permission checks
  • Returns validation violations if access is denied

Widget Properties Filter

To prevent JSON recursion, only these widget properties are returned:

  • #base_type, #date_date_format, #date_time_format, #date_timezone, #date_year_range
  • #delta, #description, #description_display, #form_group, #id, #name
  • #options, #placeholder, #required, #title, #title_display, #type

Activity

Total releases
2
First release
Jan 2026
Latest release
4 months ago
Release cadence
0 days
Stability
50% stable

Releases

Version Type Release date
1.0.0 Stable Jan 21, 2026
1.0.x-dev Dev Jan 21, 2026