Strapi v4 嵌套数据过多

Mar*_* B. 7 graphql strapi

我正在将 Strapi v3 查询重写为 v4 (GraphQL),并且使用新字段“数据”和“属性”,我遇到了过于深入嵌套对象的问题,这是数据外观的示例:

user {
  data {
    id
    attributes {
      company {
        data {
          id
          attributes {
            location {
              data {
                id
                ...
              }
          }
      }
    
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我是否在文档中遗漏了某些内容,有没有办法避免这么多嵌套,我应该在模型中重组数据吗?

T10*_*000 2

这是许多人都知道的痛点,但官方目前还没有立即解决方案。必须处理它。

https://forum.strapi.io/t/discussion-regarding-the-complex-response-struct-for-rest-graphql-developer-experience/13400/35