gatsby-source-graphcms icon indicating copy to clipboard operation
gatsby-source-graphcms copied to clipboard

Locales not working through relations

Open karlwir opened this issue 3 years ago • 1 comments

Hi,

I'm building a site with a schema quite similar to https://github.com/hygraph/reference-marketing-website. But i'm using Gatsby.

The issues lies in the Page <-> Navigation <-> Page relationship. When querying for pages, the german page's navigation holds english pages. So the navigation in German site would be in English. In the Hygraph API-playground the Navigation pages locale turns out correct.

query MyQuery { allHygraphCmsPage { nodes { locale navigation { pages { locale } } } } }

{ "data": { "allHygraphCmsPage": { "nodes": [ { "locale": "de", "navigation": { "pages": [ { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" } ] } }, { "locale": "en", "navigation": { "pages": [ { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" }, { "locale": "en" } ] } } ] } }, }

karlwir avatar Sep 02 '22 14:09 karlwir

If anyone encounters the same issue. I found a workaround by adding a localized field to the Navigation schema. This seems to make the Locale trickle through to the related pages..

karlwir avatar Sep 05 '22 07:09 karlwir