我无法使用 graphql-tools 调用嵌套解析器。我已经在github上提交了错误,但还没有得到任何回复。
https://github.com/apollographql/graphql-tools/issues/1026。
查询时未调用我的架构的嵌套字段。
架构
type XYZ {
title: String
}
type NestedLevel1 {
reference: XYZ
}
type ABCD {
title: String
reference: XYZ
nestedLevel1: NestedLevel1
}
type Query {
ABCDList(limit: Int, skip: Int): [ABCD]
}
解析器
const Resolvers = {
Query: {
ABCDList: () => []
},
ABCD: {
reference: () => [] // this function is being called
nestedLevel1: {
reference: () => [] // this function is not being called
}
}
}
正在调用顶级“reference”的解析器函数,但不是“nestedLevel1.reference”解析器。如果我做错了什么,请纠正我。