Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
11-30-2021 02:14 AM
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) :
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
Solved! Go to Solution.
11-30-2021 03:32 AM
Ok, we've found the solution by exploring Neo4j Graphql Library source code.
For anybody who got same problem, in order to make it work it's needed to include CartesianPoint value into a point object to be handled correctly by the library:
value_spatial: {
point {
x: 46.19863361913244,
y: 6.140601539612646,
}
}
11-30-2021 03:32 AM
Ok, we've found the solution by exploring Neo4j Graphql Library source code.
For anybody who got same problem, in order to make it work it's needed to include CartesianPoint value into a point object to be handled correctly by the library:
value_spatial: {
point {
x: 46.19863361913244,
y: 6.140601539612646,
}
}
All the sessions of the conference are now available online