match(ex:example)
WITH collect(ex.someStringProperty) as stringList
(your cypher here)
In other words, just run it as a pre-query, bind it to "stringList" as a variable in a cypher query, and then it functions the same as if it were a parameter, but you compute it each time.
If you don't want to compute it each time (for example because it's a big list of strings) you could compute it once, put it into a temp node, and then start with that node's value.
match(ex:example)
WITH collect(ex.someStringProperty) as stringList
CREATE (:Cache { stringList: stringList });
And then later:
MATCH (c:Cache)
WITH c.stringList as stringList
(your cypher here)
The main reason I was asking is mainly for when I'm debugging and need to use a parameter that requires some complex pre-query. Which then requires copy/pasting the pre-query for each different query I'm running relying on that param.
I had not thought about just saving the result to a temp node as you suggested which solves that problem for the most part!
Ideally I'd love to see being able to assign params to the results of a query as a feature in the future, as it saves extra steps needed to either assign the param or extra code to match on (:cache) for each query.
Perhaps I'll put that in as a feature request.