neo4j graphql模式:新查询不起作用

时间:2018-08-14 18:44:18

标签: neo4j graphql-js graphql-java

当前,我能够使用操作查询来查询neo4j DB并将时间戳作为参数传递{action:timestamp:1234567890}。但是,我试图构建一个新的查询,该查询执行操作查询但传递两个参数:startTime和endTime {action:startTime:0987654321,endTime:1234567890}。以下是我所拥有的,但间隔查询不起​​作用。有人可以提供帮助吗?谢谢。

export const typeDefs = `

type action {
  action: String!
  timestamp: Float!
  Second: [Second] @cypher(statement: "MATCH (sec:Second)<-[:AT_TIME]-(this)-[:TARGET]->(obj:object) RETURN sec")
  object: [object] @cypher(statement: "MATCH (sec:Second)<-[:AT_TIME]-(this)-[:TARGET]->(obj:object) RETURN obj")
 }

 type Second {
  time: Float
}

type object{
  filename: String!
}

type interval{
  startTime: timestamp
  endtime: timestamp
  action: [action] @cypher (statement: "WHERE action.timestamp >= startTime AND action.timestamp <= endTime RETURN sec, action, obj")
}




type Query {
    action(action: String, timestamp: Float): [action] 
    interval(startTime: timestamp, endTime: timestamp): [interval]
    object(filename: String): [object]
    Second(time: Float, action: String): [Second]

}
`;

0 个答案:

没有答案