gentics / mesh-incubator

Project which is home for planned enhancements for Gentics Mesh
3 stars 0 forks source link

GraphQL: Add language parameter to link resolving #92

Open philippguertler opened 7 years ago

philippguertler commented 7 years ago

Gentics Mesh Version, operating system, or hardware.

Enhancement

When fetching a field, you can resolve links to mesh nodes in certain fields (string, HTML).

However, the resolved link always points to the default language of that node. Add a parameter that allows to choose the language of the node.

Proposed type: Optional [String] An array of strings allows for language fallback.

Usage:

{
  node("uuid"){
    fields{
      ... on content{
        text(linkType: SHORT, lang: ["de", "en"])
      }
    }
  }
}

This also allows for multiple links to be fetched at once:

{
  node("uuid"){
    fields{
      ... on content{
        enLink: text(linkType: SHORT, lang: "en")
        deLink: text(linkType: SHORT, lang: "de")
      }
    }
  }
}