【发布时间】:2021-04-17 02:47:50
【问题描述】:
如何使用内容数据中的特定值过滤 GraphQL 查询内容。例如,我收到了以下 GraphQL 查询的结果。
query MyQuery { allPages { edges { node { content } } } }
从上面的查询中,我收到了如下内容。我正在尝试使用“类型”值(蔬菜/水果)过滤掉结果。如何过滤掉蔬菜内容以仅显示水果内容。
{ "node": { "content": [ { "type": "Fruit", "value": { "Text": "Orange" } }, { "type": "Fruit", "value": { "Text": "Apple" } } ] } }, { "node": { "content": [ { "type": "Veg", "value": { "Text": "Broccoli" } }, { "type": "Veg", "value": { "Text": "Lettuce" } } ] } }
【问题讨论】: