neo4j-contrib / neo4j-apoc-procedures

Awesome Procedures On Cypher for Neo4j - codenamed "apoc"                     If you like it, please ★ above ⇧            
https://neo4j.com/labs/apoc
Apache License 2.0
1.71k stars 493 forks source link

Problem with virtual relationships over HTTP endpoint #1775

Closed schmitze87 closed 3 years ago

schmitze87 commented 3 years ago

I run into an error trying to return a virtual relationship when using the HTTP endpoint.

Expected Behavior (Mandatory)

I expect the virtual relationship to be return in the row and meta section of the response.

Actual Behavior (Mandatory)

I'm trying to return a virtual relationship in a cypher statement. I'm using the Cypher transaction API over HTTP because usage of bolt is not allowed in my network. In former versions of neo4j (e.g. 3.5) this works fine. In the actual version (4.2.1) I get the following error:

{
    "code": "Neo.ClientError.Statement.EntityNotFound",
    "message": "Unable to load RELATIONSHIP with id -3."
}

How to Reproduce the Problem

Here are the steps to reproduce the problem

CREATE (n {name: '1'});
CREATE (n {name: '2'});
MATCH (n {name: '1'}), (m {name: '2'})
RETURN n, m, apoc.create.vRelationship(n, 'TEST', {}, m) as rel;

Here is the complete response from the request:

{
    "results": [
        {
            "columns": [
                "n",
                "m",
                "rel"
            ],
            "data": [
                {
                    "row": [
                        {
                            "name": "1"
                        },
                        {
                            "name": "2"
                        }
                    ],
                    "meta": [
                        {
                            "id": 0,
                            "type": "node",
                            "deleted": false
                        },
                        {
                            "id": 1,
                            "type": "node",
                            "deleted": false
                        },
                        {
                            "id": -3,
                            "type": "relationship",
                            "deleted": false
                        }
                    ]
                }
            ]
        }
    ],
    "errors": [
        {
            "code": "Neo.ClientError.Statement.EntityNotFound",
            "message": "Unable to load RELATIONSHIP with id -3."
        }
    ]
}

Versions

schmitze87 commented 3 years ago

duplicate