Closed visualcookie closed 4 years ago
@visualcookie I'm having the same issue anyway!
would you mind to tell me how you managed to do the translations as it works fine with the normal graphql app and when using the plugins I'm not able to fetch the translation at all!
@HashemKhalifa Sure, I did some hacky stuff for now.
{articles.map(({ node }): React$Node => {
// TODO: Remove it as soon as the filter function issue has been resolved
const translatedArticle = node.translations.filter(
a => a.language === intl.locale
)
return (
<>
{translatedArticle.map(article => (
<Article
tag={node.category}
author={node.author}
date={node.created_on}
article={article}
/>
))}
</>
)
})}
@visualcookie Thank you so much! The issue I'm currently facing is after creating the translation I can access it from the API with plain graphql for example.
{
share_campaign{
data{
translation {
language_code
title,
subtitle
}
domain{
name
}
title
subtitle
}
}
}
and with gatsby, I couldn't find the translations
object in the response.
"message": "Cannot query field \"translation\" on type \"DirectusShareCampaign\".",
@HashemKhalifa Have you checked the GraphiQL interface, that's provided with Gatsby if the translations are in there?
@visualcookie yes, not even there!
I can get only from the DirectusShareCampaignTranslation
for example but I couldn't find it in the GraphQl interface.
I followed the docs but I'm not sure if I missed something!
@visualcookie the problem is GSD7: warning Could not find an Many-To-One match in 'share_campaign' for item in 'share_campaign_translations'
@HashemKhalifa Hm, actually can't help you there. Maybe the author can help, but I don't know if he's still actively pursuing this source plugin.
@visualcookie thanks a lot, I will try to create a pull request with the fix
Hi @HashemKhalifa and @visualcookie !
Sorry for the long silence, I've been quite busy with other stuff recently. As for the issue, a new official plugin has been created at https://github.com/directus/gatsby-source, and thus this project won't be maintained anymore. You should go try it out instead and see if it works out for you and if not, open a new issue in that repo :)
Hey.
When requesting an article with a translations filter, to only get e.g.
en
, it doesn't work. It still returns all articles.