Open GreenberryServiceAccount opened 1 month ago
Update: I've now changed everywhere in my project to include the item's id
in the object that's passed as context
argument into the createPage
function from Gastby. I've updated all queries to fetch the CMS item based on the id
instead of the slug
now and it works.
For me now this problem is solved, but it still seems like something you should be able to do: fetch a CMS item based on their slug in another language than English...
I'm currently migrating from gatsby-source-datocms v4 to v5, but I'm having some trouble getting it to work. My default locale in DatoCMS is "en" and the other locale I'm using is "nl". In the previous version I could fetch an item based on the "nl" slug, but that doesn't seem to work in version 5 anymore. This should really be possible, because if, for example, I'm navigating to
/nl/nieuws/mijn-eerste-nieuws
I only know that my Dutch slug ismijn-eerste-nieuws
. I don't have the "original" English slug at my disposal. Some items don't even have an English version.I've verified that this issue exists by using the graphql explorer locally at
http://localhost:8000/__graphql
, by first getting an article in Dutch by using the English slug, eg:This gives me the correct article in Dutch, so the "locale" argument is working.
I don't get any response when I try to use the Dutch slug however, eg:
Am I missing something? There must be a way to get a specific article based on the slug in any translation, right?