Using Next.js I am building a multi-country website. I have entries in various locales in Strapi. They could have different slugs of course, in different languages.
I need to build a language switcher. So when I fetch one entry, I would like to also fetch its other entires in other locales. Mainly so I can get all the other slugs so I can add them to the language switcher.
But how does one do that? Here is my graphql, which is only returning the entries in the main default language.
I would like to avoid repeat calls to the graphql for every page on the site.
I tried products(locale: “*”) but it doesnt recognise it.
query FetchProducts
{
products
{
data
{
id
attributes
{
slug
}
}
}
}