Allow usage of langcode as an option, on nodetypes

Created on 6 November 2023, about 1 year ago

Problem/Motivation

When querying a node by id or uuid, the query returns only the original language.
But if I already know the id/uuid, there should be no need to require a url/path.

Steps to reproduce

  • Install and setup translations
  • Create a content type, and allow it's content translation
  • Create one or more nodes of the above content type and translate them
  • Install Graphql compose and its requirements. Setup approprietely
  • Configure GraphQL Compose, and activate the Content Type and its fields
  • Go to GraphQL Explorer and try to run a query using the structure below
query ArticleByID($uuid: ID!){
  nodeArticle(id: $uuid) {
    id
    langcode: {
      name
      id
    }
    title
  }
}

Proposed resolution

Add query resolver to allow the following query proposal:

query ArticleByID($uuid: ID!, $langcode: String) {
  nodeArticle(id: $uuid, langcode: $langcode) {
    id
    langcode: {
      name
      id
    }
    title
  }
}

Remaining tasks

User interface changes

None.

API changes

None.

Data model changes

None.

(Thank you for an amazing module.)

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇵🇹Portugal bmateus

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

Comments & Activities

Production build 0.71.5 2024