gentics / gentics/mesh

GraphQL filtering Children by languages is being ignored

Open
#1,092 2 comments 0 reactions 0 assignees View on GitHub
bug f/graphql
Dominant language
Java
Stars
593
Forks
123
Avg merge
2d 18h
Merged PRs (30d)
4

Description

## 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:
```gql
{
node(path:"/aircrafts") {
children(lang: ["de"]) {
elements {
language
uuid
}
}
}
}
```

[Link]( https://demo.getmesh.io/api/v2/demo/graphql/browser/#query=%7B%0A%20%20node(path%3A%22%2Faircrafts%22)%20%7B%0A%20%20%20%20children(lang%3A%20%5B%22de%22%5D)%20%7B%0A%20%20%20%20%20%20elements%20%7B%0A%20%20%20%20%20%20%20%20language%0A%20%20%20%20%20%20%20%20uuid%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D)

## Expected behaviour and actual behaviour
It should filter out all elements which are not permitted from the given language list

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied GraphQL query against the demo or a v1.5.1 instance, focusing on the node children entry point and its lang argument. Trace how the children result is assembled and compare it with the documented filtering behavior; done means non-matching languages are excluded while matching elements remain.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, java
Domain
api, backend-api-design
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.