0

Im trying to get just entrys which have in a specific value in a array (myArray: [String]).

Displaying of this Array is not Problem:

query ($lang: [String!], $filter: String!) {
  nodes(lang: $lang, filter: {schema: {is: myObj}, fields: {myObj: {name: {regex: $filter}}}}) {
    elements {
      uuid
      language
      availableLanguages
      fields {
        ... on module {
          name
          myArray
        }
      }
      node {
        language
        fields {
          ... on module {
            name
            myArray
          }
        }
      }
    }
  }
}

Result:

{
  "data": {
    "nodes": {
      "elements": [
        {
          "uuid": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
          "language": "de",
          "availableLanguages": [
            "de"
          ],
          "fields": {
            "name": "ASDF",
            "myArray": [
              "CAT_1",
              "CAT_2"
            ]
          },
          "node": null
        }
      ]
    }
  }
}

How can I filter on myArray? That I just et elements with the value uf $filter in the array myArray?

In the GraphiQL I can't find the myArray in the docs under the filter - fields.

patrick
  • 826
  • 1
  • 9
  • 28

1 Answers1

1

GraphQL-Filtering for list types is not supported yet. In the GraphiQL docs you will only find supported fields for now. See supported field types here: https://getmesh.io/docs/beta/graphql.html#_filtering_limitations

Here is the open issue on Github regarding this feature: https://github.com/gentics/mesh/issues/27

PGuertler
  • 243
  • 1
  • 2
  • 6