reactjs - Graph QL 没有返回正确的数据
问题描述
我正在尝试运行图形 ql 查询以获取某些作业的详细信息。
查询是这样的:
query getJobsSearch(
$location: String
$type: String
$category: String
$time: String
$limit: Int
) {
jobs(order_by: {created_at: desc}, where: {deleted_at: {_is_null: true}, created_at: {_gt: "2021-06-16T10:06:38.551984+00:00"},
job_category: {slug: {_eq: $category}},
location: {slug: {_eq: $location}},
job_type: {slug: {_eq: $type}}}, limit: $limit)
现在,如果 $category、$location 或 $type 为空,它不会返回正确的结果。
它实际上给我返回了一个空数组。
如果我删除这个:
job_category: {slug: {_eq: $category}},
location: {slug: {_eq: $location}},
job_type: {slug: {_eq: $type}}}, limit: $limit)
它工作正常。
有人可以告诉我哪里出错了吗?
解决方案
推荐阅读
- c++ - 尝试使用 ostream<< 运算符对象时与 {fmt} 6.2.1-3 + clang 10.0.0 的链接问题
- python - Django按大小写重新组合
- openstack - 为什么我无法访问 Openstack 元数据服务?
- python-3.x - Matplotlib 条形图条间距
- vb.net - VB.NET 将数组与 Outlook 邮件项目附件列表中的文件名值进行比较仅匹配一次,而应该发生更多匹配
- bazel - Bazel Starlark:如何以程序方式生成 BUILD 文件?
- amazon-web-services - AWS - 防止管理员用户提升自己的权限
- node.js - 尝试运行节点脚本以分配 Waves 节点和租用者的收入。但是获取套接字挂起错误,在节点脚本的 HTTP 调用中
- requirejs - 是否可以在客户端运行 FFmpeg 或类似的库?
- visual-studio - 删除github仓库后上传到github