I am trying to fetch translations for my menus using GraphQL admin API - bulk query. Menu items have only 1 level of nesting.
My query looks like this:
mutation {
bulkOperationRunQuery(
query: """
{
translatableResources(resourceType: MENU) {
edges {
node {
resourceId
translations(locale: "en") {
key
value
locale
}
nestedTranslatableResources(resourceType: LINK) {
edges {
node {
resourceId
translations(locale: "en") {
key
value
locale
}
}
}
}
}
}
}
}
"""
) {
bulkOperation {
id
status
url
errorCode
__typename
type
}
userErrors {
field
message
__typename
}
}
}
When I run this i get following error:
The parent 'node' field for a nested connection must select the 'id' field without an alias and must be of 'ID' return type. Connection fields without 'id': translatableResources.
But the node of translatableResources(resourceType: MENU) does not have id field. It only has resourceId field. I tryied anyway and I got this error:
Invalid bulk query: Field 'id' doesn't exist on type 'TranslatableResource'
That makes sense.
I dont know how to solve that. It wants me to select the field which doesnt exist in the definition.
Also tryied to remove nestedTranslatableResources(resourceType: LINK) piece and query run successfully. It only happens when I try to select nestedTranslatableResources.
Also tryied using nestedTranslatableResources with different resourceType parameter values and also completly omitting it.
Docs: translatableResources - GraphQL Admin
Thank you anyone who knows anything about this.