【发布时间】:2023-01-05 21:21:13
【问题描述】:
我是 GraphQL 的新手,使用 Flask 和 GraphQL 创建 API 服务器, 在处理 GraphQL 请求中的“where”子句时遇到一些问题。
基本的请求和响应工作正常。请找到我设计的架构的简短 sn-p
***SCHEMA***
type data{
edges:[data_edges]
}
type QueryCustom{
data:data
}
type Query {
query:QueryCustom
}
下面提到的基本请求(没有 where 子句)在这个模式下工作正常
**REQUEST:**
query{
query{
data{
edges{....}
但是当我使用 where 子句执行请求时出错
query dataClosingSoon($month: Long) {
data(
where: {LastModifiedDate: { CALENDAR_MONTH: { value: { eq: $month } } }}
) {
edges { ....... }
错误
{
"errors": [
{
"locations": [
{
"column": 40,
"line": 1
}
],
"message": "Unknown type 'Long'."
},
{
"locations": [
{
"column": 9,
"line": 5
}
],
"message": "Unknown argument 'where' on field 'QueryCustom.data'."
}
]
}
我需要了解如何处理 where 条件和
【问题讨论】: