Make required fields in Graphql configurable for required fields in Drupal

Created on 29 February 2024, 9 months ago
Updated 11 April 2024, 8 months ago

Problem/Motivation

Comment of CedricL in 💬 Entity references to archived nodes causing errors and null responses Fixed

I provided a patch so you don't have to put things in the settings file like this $config['graphql_compose.settings']['field_config']['paragraph']['YOUR_PARAGRAPH_TYPE']['FIELD_YOUR_FIELD_NAME']['required'] = FALSE;
But now you can do it the schema configurer, i've added a checkbox required which by default is set the same as the settings of your field. But you can override it and make that field not required for the schema in GraphQL.

When saving it, the required value gets added to the config.

Not sure if this breaks anything else, but for our use case i haven't seen it breaking something. Should be tested and reviewed

- @CedricL

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Feature request
Status

Fixed

Version

2.1

Component

Code

Created by

🇧🇪Belgium JeroenT 🇧🇪

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

Comments & Activities

Production build 0.71.5 2024