Fallback locales should be considered for filtering and sorting (GraphQL)

Let’s assume this dataset:

{
   "pages": [
      {
         "title": {
            "en": "Lake Geneva",
            "de": "Genfersee"
         }
      },
      {
         "title": {
            "en": "Islisberg",
            "de": ""
         }
      }
   ]
}

And now let’s make these queries:

query {
   a: page(filter: {title: {eq: "Islisberg"}}, locale: de, fallbackLocales: [en]) {
      title
   }
   b: allPages(orderBy: title_ASC, locale: de, fallbackLocales: [en]) {
      title
   }
}

which results in:

{
   "data": {
      "a": null,
      "b": [
         {
            "title": "Islisberg"
         }
         {
            "title": "Genfersee"
         },
      ]
   }
}

while the expected result would be:

{
   "data": {
      "a": [
         {
            "title": "Islisberg"
         }
      ],
      "b": [
         {
            "title": "Genfersee"
         }
         {
            "title": "Islisberg"
         },
      ]
   }
}

To me, this is a bug. The fallbackLocales must be used for the eq filter as well as for the orderBy clause.

@tools-dt_myswitzerland This is something we are aware of, it is something we want to address in the future and is on our current roadmap, but for now the current default behaviour is that the fallback locales are only used to fallback when returning results, not when filtering

Thank you for the feedback!

Hi, I’m running into the same issue. Is a solution or workaround available?

Hello @petercoolen and welcome to the community!

Not at the moment, unfortunately :frowning:

1 Like