这是我尝试在graphQl查询中使用与众不同的查询:
query{
contacts(take: 10, distinct: true) {
firstName
lastName
title
}
}
但是我得到了错误:
{
"errors": [
{
"message": "Unknown argument \"distinct\" on field \"contacts\" of type \"QuerySchema\".",
"locations": [
{
"line": 2,
"column": 21
}
]
}
]
}
最佳答案
GraphQL没有内置的排序/过滤功能。由服务器来实现类似的功能,因此,如果您依赖第三方API并且它不支持它,那么您将不得不自己过滤响应。
关于graphql - 如何在GraphQL查询中使用distinct?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46552167/