这是我尝试在graphQl查询中使用与众不同的查询:
query{
contacts(take: 10, distinct: true) {
firstName
lastName
title
}
}
Run Code Online (Sandbox Code Playgroud)
但我得到了错误:
{
"errors": [
{
"message": "Unknown argument \"distinct\" on field \"contacts\" of type \"QuerySchema\".",
"locations": [
{
"line": 2,
"column": 21
}
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
azn*_*nix -3
这是一个不同查询的示例。
query {
contacts {
distinct(field: title)
}
}
Run Code Online (Sandbox Code Playgroud)
结果将会是。
{
"data": {
"contacts": {
"distinct": [
"This is my test post",
"This is my test post1",
"This is my test post2"
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
此查询绑定所有标题并删除重复项。
归档时间: |
|
查看次数: |
2752 次 |
最近记录: |