Neo4j GraphQL Library @cypher: Parameters with empty string values

Hello Community,

I am currently in the process of migrating from Neo4j GraphQL Library from v3 via v4 to v5.

Specifically in the @cypher directive I noticed a different behaviour after migrating from v3.24.3 to v4.3.4 in terms of handling string parameters with empty string values ("").

Since v4 string parameters with empty values seem to get translated into NULL within the Cypher statement instead being kept as empty string"", which was the previous behaviour in v3.24.3.

This is not optimal, since within the Cypher I can no longer differentiate if an optional string parameter was just not set or if it was set to "" and some of our Cypher statements rely on this specific differentiation.

I could not find anything regarding to this change in the migration guide or in other parts of the docs. Does somebody know if there is a way to bring back the old behaviour, e.g. with a configuration flag or the like? Or also for curiosity, can somebody explain what is the background/purpose of this change?

Thanks a lot in advance!

H @playgoplay,
seems to me that you encountered the same bug report raised here When a boolean parameter to a cypher directive is false NULL is inserted instead · Issue #4831 · neo4j/graphql · GitHub,
I provided a fix that will soon be available, and sorry again for the inconvenience!
Have a great day!

Cheers,
Simone

2 Likes

Hi @simone.gammicchia ,

wow, thank you so much for the fast response and for leading me to the right issue!! I didn't find it since I was always searching for issues with "empty string" or similar, but this context makes totally sense.

Even more amazing that it's already gotten fixed in the meantime. Looking forward to the next release!

Thanks again for the support and your great work.

All the best

The problem is gone with the latest release v5.2.0.

Thanks again!

No problem! Yes, we included this fix in version 5.2.0!