Hi Michael,
I can't give you the code, but I can probably work up a test case. Although it's actually pretty simple. Just create two nodes with a relationship between them. Then issue a Cypher query that would find one of the nodes (it could just be a simple query on some property of one of the nodes) and delete that node. So something like
START n = node(*) WHERE n.myprop = something DELETE n
As to what error I'm expecting... I would expect an error in the HTTP status code. But I understand that there's some controversy around this since the resource I'm addressing via the /cypher endpoint is the query itself and the query was valid. This is part of the problem in issuing queries in a RESTful API. Anyway, could you tell me what I should expect? I think there are 3 cases:
- The query was valid and the delete was successful and one or more entities were deleted. I would expect to get an HTTP 200. Not sure what I should see in the payload although some indication of which entities or how many entities were deleted would be helpful.
- The query was valid and the delete was successful, but no entities were deleted because the predicate didn't match any entities. I would expect an HTTP 200 here.
- The query was valid and the delete was NOT successful due to an error (such as the constraint violation I described). What is the expected behavior here?
- The query was invalid. I'd expect at least an error in the HTTP status (probably a 400) and maybe some more details in the payload.
Thanks.
-brian