我有一个模式类型Page,它有一个块数组:
{
title: 'Page',
name: 'page',
type: 'document',
fields: [
...
{
title: 'Blocks',
name: 'blocks',
type: 'array',
of: [
{type: 'tileGrid'},
{type: 'otherType'}
],
options: {
editModal: 'fullscreen'
}
}
]
}
类型tileGrid
包含以下字段:
{
title: 'Tiles',
name: 'tiles',
type: 'array',
of: [{
type: 'reference',
to: [
{type: 'tile'}
]
}]
}
因此tile
类型是深层嵌套的page.blocks[].tiles[].tile
。
如何查询page
并在同一查询中填写tile
引用?
答案 0 :(得分:2)
由于tile是引用,因此您需要解除引用运算符,而不是点运算符。这应该有效:page.blocks[].tiles[]->
。