这是我的架构的结构
type Process @query(read: true, aggregate: true) {
material_id: String
batch_id: String
basic_mat: String
happened: Date
}
现在,查询过程返回一个空数组
query Processes($where: ProcessWhere) {
processes(where: $where) {
basic_mat
material_id
batch_id
}
}
这是变量
{
"where": {
"batch_id": "abc101"
}
}
我进一步启用调试,这就是我得到的
@neo4j/graphql:auth using JWT provided in context: undefined +0ms
@neo4j/graphql:execution executing cypher +0ms
@neo4j/graphql:execution CALL dbms.components() YIELD versions, edition UNWIND versions AS version RETURN version, edition +1ms
@neo4j/graphql:execution cypher params: {} +0ms
@neo4j/graphql:translate ReadOperation
@neo4j/graphql:translate |──── PropertyFilter [batch_id] <EQ>
@neo4j/graphql:translate |──── AttributeField <basic_mat>
@neo4j/graphql:translate |──── AttributeField <material_id>
@neo4j/graphql:translate |──── AttributeField <batch_id> +0ms
@neo4j/graphql:execution executing cypher +655ms
@neo4j/graphql:execution MATCH (this:Process)
@neo4j/graphql:execution WHERE this.batch_id = $param0
@neo4j/graphql:execution RETURN this { .basic_mat, .material_id, .batch_id } AS this +0ms
@neo4j/graphql:execution cypher params: { param0: 'abc101' } +0ms
@neo4j/graphql:execution Execute successful, received 0 records +0ms
在 neo4j 中运行此密码会返回值,但当我使用 neo4j/graphql 库时不会返回值。 知道问题出在哪里吗
解决了,
需要将其添加到上下文中
sessionConfig: { database: "myNeoGraph" }