Hi, I am trying to pass a graph ql arguments array in cypher query. I am having difficulty making query work. I can see the parameter passed correctly while doing a console log. However, when I try to utilize it with node js. Neo4j driver is not doing anything. I think, I am doing something wrong. Could anyone please guide me.
const query = `UNWIND $list as batch
match ((u:user { ohrid: ${ctx.ohrid}})-[:FILE_SHARED_WITH| FILE_SHARED_WITH_GROUP| MEMBER_OF_GROUP*..2]-(f:file)) where f.uuid = batch.uuid
SET f.documentStatus = batch.documentStatus
return f as files`;
const queryParams = { list: args.documents };
const result = await session.run(query, queryParams);
if i use the same query in neo4j browser it works fine
UNWIND [{uuid: "5f668fbb-70b3-4713-bc91-18727fb5ac65", documentStatus: "unpublished"}, {uuid: "84e0575c-9c5c-43b5-a4fc-3af99bcf98ec", documentStatus: "unpublished"}] as batch
match ((u:user { ohrid: 850046714})-[:FILE_SHARED_WITH| FILE_SHARED_WITH_GROUP| MEMBER_OF_GROUP*..2]-(f:file)) where f.uuid = batch.uuid and any(x in batch.documentStatus where x in ['published', 'unpublished'])
SET f.documentStatus = batch.documentStatus
return f
my apologies, I have updated the query accordingly now. I was trying out something and pasted that query here. I have tried many ways none of them are working.
some docs says use {list}, others says $list. so far none working for me.