sanity-plugin-intl-input
sanity-plugin-intl-input copied to clipboard
Cannot get translation string in GraphQL
Hi! I am using intl-input just for objects and have done the following:
intl-input.json
"languages": [
{ "name": "en", "title": "English" },
{ "name": "tw", "title": "中文" }
]
Document schema
export default {
title: 'Media',
name: 'media',
type: 'document',
fields: [
...
{
title: 'Name',
name: 'name',
type: 'mediaTranslate'
},
...
]
}
export default {
title: 'Translate',
name: 'mediaTranslate',
type: 'object',
options: {
i18n: true
},
fields: [{
title: 'Translate',
name: 'translate',
type: 'string'
}]
}
Then do sanity graphql deploy
and try queries in playground.
However, I got translation
as a string and all of them are null
.
type MediaTranslate {
_key: String
_type: String
translate: String
}
What is the correct way to get i18n data for object level? Thank you!