Hello,
We would like to migrate from neo4j-graphql-js
to Neo4j GraphQL Library
.
We got an issue with CartesianPoint and can't find the solution.
Here's the problem. We've a custom resolver that return a Post object (which match our schema). Everything works except the field with CartesianPoint (from a nested object) who return this error:
[GraphQL error]: Message: Cannot read property 'x' of undefined,
In front it's fetched via GraphQL like this:
Post {
CustomFieldContent {
[...]
value_spatial {
x
y
}
}
}
On backend, when we log our Post object we've a correct object for value_spatial. If no value, it's null. Else, when we got a value, we've tested 2 differents approach to define the object (both return the previous error) :
- Cusom => value_spatial: { x: 46.19863361913244, y: 6.140601539612646 }
- Cypher Point object => value_spatial: Point {
srid: [Integer],
x: 46.19863361913244,
y: 6.140601539612646,
z: undefined
}
Here's our types:
type CustomFieldContent {
[...]
post: Post @cypher(statement: "MATCH (this)<-[:DEFINED_WITH]-(post) RETURN post"),
value_spatial: CartesianPoint,
}
type Post {
[...]
customFieldContents: [CustomFieldContent] @cypher(statement: "MATCH (this)-[:DEFINED_WITH]->(cfc) RETURN cfc ORDER BY cfc.field_order")
}
It seems the issue comes from the Neo4j GraphQL Library as the object we retrun thru the resolver is correct (and was working with neo4j-graphql-js).
FYI, we've also tested to replace custom @cypher statement with traditional @relationhship approach but it doesn't change the behaviour.
Any idea where is the problem?
Thank you
Jonas