在嵌套的 Prisma/GraphQL 查询中找不到参数

Could not find argument in nested Prisma / GraphQL query

在我的 graphql-yoga 服务器中,我有一个这样的模式:

type Play {
  id: ID!
  frames: [Frame!]!
}

type Frame {
  id: ID!
  play: Play!
}

query  {
  play(playId: "myid") {
    id
    ### The error occurs when I uncomment these lines:
    # frames {
    #   id
    # }
  }
}

我有查询的解析器:

return await context.prisma.play({ id: args.playId })

我也有关系的解析器,例如:

const frames = async (root, args, context) => {
  return await context.prisma.frames({ play: { id: root.id }})
}

当我 运行 带有注释行的查询时,它会按预期执行。当我添加关系时,出现错误:

Error: Could not find argument play for type Frame
    at server\node_modules\prisma-client-lib\dist\Client.js:248:31
    at Array.forEach (<anonymous>)
    at server\node_modules\prisma-client-lib\dist\Client.js:234:50
    at Array.reduceRight (<anonymous>)
    at Client.generateSelections (server\node_modules\prisma-client-lib\dist\Client.js:231:32)
    at Client.<anonymous> (server\node_modules\prisma-client-lib\dist\Client.js:87:35)
    at step (server\node_modules\prisma-client-lib\dist\Client.js:47:23)
    at Object.next (server\node_modules\prisma-client-lib\dist\Client.js:28:53)
    at server\node_modules\prisma-client-lib\dist\Client.js:22:71
    at new Promise (<anonymous>)

我正在使用 prisma-client-lib@1.18.1graphql-yoga@1.16.2graphql@0.13.0

原来这个错误是在解析器中,尽管堆栈跟踪没有帮助。我改变了

const frames = async (root, args, context) => {
  return await context.prisma.frames({ play: { id: root.id }})
}

const frames = async (root, args, context) => {
  return await context.prisma.frames({ where: { play: { id: args.playId }}})
}