How to do dynamic patcher feature in cypher?

I want to have some patcher config in a node, so every query start from that node will apply the patcher.
I use movie db to easy to demo.

  • add patcher
MATCH(p:Person {name:"Tom Hanks"})
SET someMagic(p, 'm:Movie {title:"Cast Away"}', released, 100)

This will change the Cast Away movie released to 100 when query from Tom Hanks

  • query without patcher
MATCH(m:Movie {title:"Cast Away"})
RETURN m.released

2000, return node's property as normal query

  • query with patcher
MATCH(p:Person {name:"Tom Hanks"})-[:ACTED_IN]-(m:Movie {title:"Cast Away"})
RETURN m.released

100, return node's property after apply patcher

This feature only active when query start from the node which has patcher.
And it doesn't effect real data.

I am sorry. I don’t understand what you are doing. Is the “sameMagic” method setting the release date of the related movie node that has the specified title? If so, I think you can approach this in two ways: 1) write a custom procedure, or 2) define an apoc custom procedure.

User-defined procedures - Java Reference.

No, I don't want to "change" the node's property.

You can see the 2 query example, it's return two different value for the same node property.