Gatbsy source strapi locale 'all' for singleTypes #375
Unanswered
NevenaKirova
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i changed the controller configuration in strapi using this function :
module.exports = ({ strapi }) => ({
async find(ctx) {
if (ctx.query.locale === 'all') {
const localesArray = await strapi.plugins.i18n.services.locales.find()
const locales = localesArray.map(locale => locale.code);
}
});
so i can get all the locales. It is kind of working but only for two pages. For the rest of the pages it either returns only the default locale or i can no longer see it in the Graphql schema. The problem with the data missing from graphql happens when i add
to the singleType configuration, which is needed, so i can get all locales.
Those are three examples for one that is working, one that is only returning the default locale and, one that is not appearing in graphql after this configuration (landing-page)
Beta Was this translation helpful? Give feedback.
All reactions