You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何从UpWorks GraphQL API获取vendorProposals?参数错误求助

解决UpWorks GraphQL API拉取vendorProposals时的VJCA-6错误

我尝试通过UpWorks GraphQL API拉取状态为Accepted的vendorProposals,使用了以下查询语句:

{
    vendorProposals(filter: {status_eq: Accepted}, sortAttribute: {field: CREATEDDATETIME, sortOrder: DESC}, pagination: {first: 100, after: "1"}) {
    totalCount
  }
}

但始终返回包含VJCA-6错误码的通用参数错误:

{
  "errors": [
    {
      "message": "Input parameter provided has incorrect value",
      "locations": [
        {
          "line": 2,
          "column": 2
        }
      ],
      "path": [
        "vendorProposals"
      ],
      "extensions": {
        "code": "VJCA-6",
        "details": ""
      }
    }
  ],
  "data": null
}

排查方向及修复方案

  • 修正分页after参数格式
    UpWorks GraphQL的after分页参数需要的是游标(cursor)值,而非数字字符串"1"。首次查询可以直接省略after,后续分页时使用查询返回的pageInfo.endCursor作为after的值。调整后的首次查询:

    {
        vendorProposals(filter: {status_eq: Accepted}, sortAttribute: {field: CREATEDDATETIME, sortOrder: DESC}, pagination: {first: 100}) {
        totalCount
        pageInfo {
          endCursor
          hasNextPage
        }
      }
    }
    
  • 验证status_eq枚举值合法性
    确认Accepted是否是ProposalStatus枚举的合法值。部分API会使用全小写(accepted)、全大写(ACCEPTED)或其他格式,可在GraphQL Explorer的文档面板中查看该枚举的所有有效值。

  • 核对排序字段名
    检查CREATEDDATETIME是否为正确的排序字段名,可能正确名称是CREATED_DATE、createdDatetime等,以API文档中的定义为准。

  • 简化查询逐步定位问题
    先去掉过滤和排序参数,仅保留基础查询验证可用性,再逐个添加参数测试:

    {
        vendorProposals(pagination: {first: 10}) {
        totalCount
      }
    }
    

    基础查询成功后,依次加入sortAttribute、filter参数,确定具体引发错误的参数项。

内容的提问来源于stack exchange,提问作者Ryan Beasley

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.03 02:22:46