simplifies transaction response parse, fixes path/nodes bug #249
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes neo4jrb/activegraph#1125 and, in the process, simplifies our handling of responses from transactions.
Neo4j Server provides different JSON formats. When returning data from the legacy Cypher endpoint, you get an arrays of data in what they call REST format, which contains everything we need:
metadata
(labels, type, id) andproperties
. When returning from the transactional endpoint, you get... I don't remember what the default is called, but it doesn't give us what we need, so we also tell it to include the REST format separately. The result is two keys, one containing the default transaction response, the other containing the more complete response.What we were doing was complicated. We were looking for transaction responses and then keeping track of how far along we were in a loop through the default, insufficient data, and then supplementing it with data from the other, complete REST representation. This could lead to weird problems when things didn't map as expected, like when returning paths.
The solution is really simple: as soon as possible, figure out if you're dealing with a transaction. If so, just work entirely from the REST representation and ignore the weak transaction response entirely. It simplifies a lot of code and fixes the original problem.