Dynamically fetch locales

Is there a way to dynamically fetch the active locales in a Prismic repo?

It seems redundant to have to hardcode the same values in the plugin configuration for the available locales:

I'm using gatsby-source-prismic-graphql but I couldn't find any way to do this outside of the plugin either, i.e. even a manual fetch request to the Prismic API.

1 Like

This issue has been closed due to inactivity.

Hey, @sean, we do provide this list through the /api endpoint of our API. If you query this endpoint you'll get the list of languages used in your prismic repository. I don't think the gatsby-source-prismic-graphql plugin supports the dynamic fetching of those languages. So you could maybe do a PR to support this.

Does that answer your question ?

1 Like