hey community,
I wanted to ask that can we use apoc procedures inside a custom defined procedure.
I have the following situation :
CALL apoc.custom.declareProcedure('familyTree(app_num::STRING) :: (tree::ANY)',
' MATCH (p:PATENT {app_num : $app_num})
CALL apoc.path.subgraphNodes(p, {
relationshipFilter: "IS_PARENT_OF",
labelFilter : "PATENT" ,
uniqueness : "NODE_GLOBAL"
})
YIELD node
With node.app_num as application
optional MATCH (parent:PATENT)-[:IS_PARENT_OF]->(:PATENT {app_num : application} )
optional Match (:PATENT {app_num : application} )-[:IS_PARENT_OF]->(child:PATENT)
WITH collect(distinct child.app_num) as children, collect(distinct parent.app_num) as parents, application
return application, children , parents'
)
and for this query i get the following error :
Failed to invoke procedure `apoc.custom.declareProcedure`: Caused by: java.lang.RuntimeException: Query results do not match requested output.
As far as I can understand there is a mismatch in return type of expectation and the actual return type.
For that I changed the return type from MAP
to ANY
as you can see in the above query but still I got the same error.
Or that we can not use apoc procedures inside the custom ones ?
I am using neo4j v 5.6.0
Regards,
Aman