与Strapi论坛有关 - >
是否有任何弹性的方法来请求动态区域通过GraphQl而不明确定义它们在查询中?
例如,我不想做这样的事情:
query Homepage {
components {
... on SliderComponent {
image
text
}
... on ParagraphComponent {
title
description
}
// and so on...
}
}
相反,我希望能够在不单独查询的情况下获得所有动态区域。
因此,理想情况下将是这样的事情:
query Homepage {
components
}
这将返回所有可能的动态区域组件及其嵌套字段。
最好的情况是使用RESTAPI http:// localhost中的内容查询动态区域中的所有嵌套数据:1337/api/pages?pupulate [dynamiczones]
注意:我知道上面的查询不正确,是不正确的,但这只是查询形状的想法。
Related to Strapi forum -> https://forum.strapi.io/t/resolved-cant-get-the-data-from-nested-components-within-dynamic-zones/15896/3
Is there any elastic way to request dynamic zones via Graphql without explicitly defining each of them in a query?
For example, I DON’T want to do something like this:
query Homepage {
components {
... on SliderComponent {
image
text
}
... on ParagraphComponent {
title
description
}
// and so on...
}
}
Instead, somehow, I’d like to be able to get all of the dynamic zones without querying them separately.
So ideally would be something like this:
query Homepage {
components
}
and that would return all of the possible dynamic zone components with their nested fields.
The best scenario is to query all the nested data within the dynamic zones using something like in RestApi http://localhost:1337/api/pages?populate[dynamiczones]
NOTE: I know that the queries above are not correct, but this is just an idea of the query shape.
发布评论