hygraph / gatsby-source-graphcms

The official Gatsby source plugin for GraphCMS projects
https://graphcms.com
MIT License
145 stars 41 forks source link

Locales not working through relations #245

Open karlwir opened 2 years ago

karlwir commented 2 years ago

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 commented 2 years ago

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..