2

我是 Neo4j 的新手,过去几天一直在学习如何通过 Grandstack 将 GraphQL 与 Neo4j 一起使用。我一直在研究这个指南这个存储库来设置方案。我一直在处理示例neo4j 电影数据库我正在尝试进行基本查询,在该查询中,我使用密码查询通过评级来选择电影,如下所示。在浏览器中进行测试时,我收到以下错误。知道如何解决这个问题或我做错了什么谢谢

   const typeDefs = `
type Movie {
    title: String
    tagLine: String
    released: Int 
    reviews: [Reviewed] 
}
type Reviewed @relation(name: "REVIEWED"){
    from: Person
    to: Movie
    summary: String
    rating: String
}
type Person {
    name: String
    born: Int
    actedIn: [Movie] @relation(name: "ACTED_IN",direction:"OUT")
}

type Query {
    Movie(title: String ,released: Int, first: Int, offset: Int): [Movie]
    ReviewsByScore(score: Int): [Reviewed] @cypher(statement: "MATCH()-[r:REVIEWED]-() WHERE r.rating >= $score RETURN r;")
}
`;

const schema = neo4jgraphql.makeAugmentedSchema({ typeDefs });

在浏览器中,我运行以下查询

{
  ReviewsByScore(score: 100) {
    rating
    summary
    to{
      title
    }
  }
}

并收到以下错误。

{ "errors": [ { "message": "Cannot read property 'value' of undefined", "locations": [ { "line": 2, "column": 3 } ], "path": ["ReviewsByScore" ], "extensions": { "code": "INTERNAL_SERVER_ERROR", "exception": { "stacktrace": [ "TypeError: Cannot read property 'value' of undefined", " at getRelationTypeDirective (/Users/a123456/Desktop/Neo4j测试 Javascript/node_modules/neo4j-graphql-js/dist/utils.js:763:7)", "在 buildCypherSelection (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/selections.js:184:64)", " 在递归 (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules /neo4j-graphql-js/dist/selections.js:87:33)", "在 buildCypherSelection (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/selections.js:176: 12)", " 在递归 (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/selections.js:87:33)", " 在 buildCypherSelection (/Users/a123456/Desktop/ Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/selections.js:176:12)", "在 customQuery (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/translate.js:575:68)", " 在 translateQuery (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules /neo4j-graphql-js/dist/translate.js:518:12)", "在 cypherQuery (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:146: 40)", " 在 _callee$ (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:73:31)" ] } } } ], "data": { “ReviewsByScore”:空 } }12)", " 在 cypherQuery (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:146:40)", " 在 _callee$ (/Users/a123456/Desktop /Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:73:31)" ] } } } ], "data": { "ReviewsByScore": null } }12)", " 在 cypherQuery (/Users/a123456/Desktop/Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:146:40)", " 在 _callee$ (/Users/a123456/Desktop /Neo4j 测试 Javascript/node_modules/neo4j-graphql-js/dist/index.js:73:31)" ] } } } ], "data": { "ReviewsByScore": null } }

4

0 回答 0