We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When you add just nodes in the graph and no edges, you get an error in the function getCommitQuery().
One solution to fix the issue.
public function getCommitQuery(): QueryInterface { $query = 'CREATE '; foreach ($this->nodes as $index => $node) { $query .= $node->toString(); // split the $query in $query->toSring() and ', ' if ($index < count($this->nodes) - 1) { // added this line $query .= ','; } } $edgeCount = count($this->edges); if(!empty($edgeCount)){ // check or you get an error if(count($this->nodes) != 0) $query .= ', '; // added this line foreach ($this->edges as $index => $edge) { $query .= $edge->toString(); if ($index < $edgeCount - 1) { $query .= ','; } } } return new Query($this->name, $query); }
The text was updated successfully, but these errors were encountered:
I think tests are missing, too. Could you send a PR with tests?
Sorry, something went wrong.
I didn't test much, I was just inserting some nodes without edges and then I got an error and looked through the code.
No branches or pull requests
When you add just nodes in the graph and no edges, you get an error in the function getCommitQuery().
One solution to fix the issue.
The text was updated successfully, but these errors were encountered: