如何在单个查询中填充引用数组



>我有一个架构类型页面,它有一个块数组:

{
  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引用?

由于磁贴是引用,因此需要取消引用运算符,而不是点运算符。这应该有效:page.blocks[].tiles[]-> .

最新更新