Translations field is tied to widget setting

Created on 23 October 2024, 2 months ago

Problem/Motivation

Translations are supported as a field now on nodes ie; as property 'translations'. I wasn't seeing these show up and tracked it down to this check in isTranslatableContent():

https://git.drupalcode.org/project/graphql_compose/-/blob/2.3.x/src/Wrap...

The setting it's checking for is in the content language settings that determines if a language switcher widget should be shown on forms which I personally don't think graphQL Compose should be concerned with since its purely a UX feature. On the project I'm working on now, we don't allow content authors to change language on nodes so that setting is naturally not checked. Once I checked the setting, i now see translations showing up for the query but its not ideal as I'll have to ensure the widget is now hidden on several form displays.

Steps to reproduce

Enable language support for a content type. Uncheck the 'Show language selector on create and edit pages' setting. In graphQL explorer, notice no translations show up. Go back and check the setting and notice they now show up.

Proposed resolution

  1. Ideally, remove that extra check for the setting and just rely on whether the config exists for the entity.
  2. Alternatively, update the documentation for clarity around ensuring users understand why they might be struggling in the same way as myself to see this property in the query.
πŸ’¬ Support request
Status

Active

Version

2.2

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States apmsooner

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

Comments & Activities

Production build 0.71.5 2024