Can someone please show me how to write a graphQL query from this cypher?
MATCH (n:MyNode)
WHERE n.location.latitude > 40.8 AND n.location.latitude <41.5
AND n.location.longitude > -8.7 AND n.location.longitude < -6.8
RETURN n
Rather than using location_LT, I want to be able to use latitude_LT/GT and longitude_LT/GT to constrain the search for nodes based on a bounding box.
Thanks!
Do you mean Neo4J's GraphQL ?
You can use the toolbox?
I will explore the toolbox thank you!
To clarify a little, I've built a GraphQL API (my first), to provide a user-friendly access to a Neo4j Knowledge Graph instance. The part in the GraphQL schema I'm interested in adapting looks like this:
type MyNode @node {
Id: String!
location: Point!
}
input MyNodeWhere {
Id: String
location: PointWhere
location_LT: PointDistance
location_GT: PointDistance
AND: [MyNodeWhere!]
OR: [MyNodeWhere!]
NOT: MyNodeWhere
}
input PointWhere {
latitude: Float
longitude: Float
latitude_LT: Float
longitude_LT: Float
latitude_GT: Float
longitude_GT: Float
crs: String
}
But it seems my approach to defining PointWhere is wrong, I'm not sure why.
Any errors you could share?
I recommend you connect to your Neo4j DB using our GraphQL Toolbox
This will
- Generate Type Definitions using introspection on your Neo4j DB
- Allow you create queries / mutations using a 'point and click' approach
Please do let us know how you get on and post the Type Defs from the Toolbox back here if you need further assistance