在我的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.1
,graphql-yoga@1.16.2
并且graphql@0.13.0