I've recently been trying to create a basic multilingual wordpress website using gatsby.
For now, I have been able to fetch my main page and its english translation, as follow :
{
"node": {
"wpml_translations": [
{
"locale": "fr_FR",
"wordpress_id": 2,
"post_title": "Page d’exemple",
"href": "http://bdr.local/page-d-exemple/"
}
],
"slug": "example-page",
"title": "Example page",
"wordpress_id": 24,
"wpml_current_locale": "en_US"
}
},
However, I am missing the slug from the translated page in order to create a proper link to it, and I'd rather not take it from the page url that's given from the url.
Will I have to fire a second graphql request using the ID provided in the wpml_translations, or am I missing something?
Thank you !