Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locales not working through relations #245

Open
karlwir opened this issue Sep 2, 2022 · 1 comment
Open

Locales not working through relations #245

karlwir opened this issue Sep 2, 2022 · 1 comment

Comments

@karlwir
Copy link

karlwir commented Sep 2, 2022

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
Copy link
Author

karlwir commented Sep 5, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant