Is there a way to add custom scalars with neo4j graphql library. I am using neo4j 4.4 with apollo server.
I want to write a query for my graphql API that returns the result the following cypher query from my database :
match (p:PATENT {app_num : "17037200"})
CALL apoc.path.subgraphNodes(p, {
relationshipFilter: "IS_PARENT_OF"
})
YIELD node
with distinct node as p
optional match (parent:PATENT)-[:IS_PARENT_OF]->(p)
with distinct parent as unique_parent ,p
with collect(unique_parent.app_num) as parents, p
optional match (p)-[:IS_PARENT_OF]->(child:PATENT)
with distinct child as unique_child ,p, parents
with collect(unique_child.app_num) as children, p.app_num as application, parents
return application, parents, children
This returns a json type structure and I want this custom query to be served at my apollo API as a data point.
What are my options ?
I also want to mention that if we normally make a scalar like we do in apollo then we loose the magic of neo4j graphql library which generates a CRUD API for us.
Is there a way in which we can do both i.e create a scalar and also let the neo4j graphql library do the magic.
I was not able to find any thing related to in the docs.