mesh icon indicating copy to clipboard operation
mesh copied to clipboard

GraphQL filtering Children by languages is being ignored

Open deckdom opened this issue 4 years ago • 2 comments

Gentics Mesh Version, operating system, or hardware.

  • v1.5.1

Operating System

  • Linux

JVM

  • Open JDK 11.0.5 (Docker Container)

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

deckdom avatar Jul 08 '20 12:07 deckdom

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

philippguertler avatar Jul 10 '20 08:07 philippguertler

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.

EdgarKisman avatar Apr 13 '21 14:04 EdgarKisman