gentics / mesh

Gentics Mesh - The open source headless CMS for developers
https://getmesh.io
Apache License 2.0
571 stars 115 forks source link

GraphQL filtering Children by languages is being ignored #1092

Open deckdom opened 4 years ago

deckdom commented 4 years ago

Gentics Mesh Version, operating system, or hardware.

Operating System

JVM

Problem

When using the children in GraphQL, it describes the lang Parameter as follows:

lang: [String] Language tags to filter by. When set only nodes which contain at least one of the provided language tags will be returned

When putting that to a test, it does sadly not filter anything and returns all elements regardless.

Reproducer

Can be tested on the demo with following query:

{
  node(path:"/aircrafts") {
    children(lang: ["de"]) {
      elements {
        language
        uuid
      }
    }
  }
}

Link

Expected behaviour and actual behaviour

It should filter out all elements which are not permitted from the given language list

philippguertler commented 4 years ago

Currently the behavior is to fall back to the default language if the children have no content in the desired language.

See also https://github.com/gentics/mesh/issues/971

EdgarKisman commented 3 years ago

Same Problem here. It ignores all other languages and only checks for the first provided language in the array, in my case "de".

Example query

node(path:"/foo"){ children(lang: ["de", "en"], filter: {fields: {Bar: {name: {equals: "Something"}}} }){ elements{ languages{ language displayName uuid } } } }

the example query would show no matches, but if i change the lang array to ["en", "de"] it will find a node.