【发布时间】:2021-07-29 03:23:36
【问题描述】:
只需要包含 EmailMarketing 标签的文章。
我可能在标签上进行了错误的搜索,因为它是一个值数组,而不是单个对象,但我不知道如何正确地做,我只是在学习 graphql。任何帮助将不胜感激
查询:
query {
enArticles {
title
previewText
tags(where: {name: "EmailMarketing"}){
name
}
}
}
结果:
{
"data": {
"enArticles": [
{
"title": "title1",
"previewText": "previewText1",
"tags": [
{
"name": "EmailMarketing"
},
{
"name": "Personalization"
},
{
"name": "Advertising_campaign"
}
]
},
{
"title": "title2",
"previewText": "previewText2",
"tags": [
{
"name": "Marketing_strategy"
},
{
"name": "Marketing"
},
{
"name": "Marketing_campaign"
}
]
},
{
"title": "article 12",
"previewText": "article12",
"tags": []
}
]
}
}
【问题讨论】:
-
这实际上取决于您查询的 API。这是 Hasura 数据库还是其他什么?
标签: graphql