arangodb / arangojs

The official ArangoDB JavaScript driver.
https://arangodb.github.io/arangojs
Apache License 2.0
604 stars 107 forks source link

graph.vertexCollection.save() does not return a doc but an http response #354

Closed sylvainlap closed 6 years ago

sylvainlap commented 8 years ago

According to https://github.com/arangodb/arangojs#graphvertexcollectionsave, vertexCollection.save() should return a doc. However, it returns an object with 3 attributes: code, error & vertex.

Proof is in this screenshot (see the console, with is the log of "result").

2016-11-15 1

pluma commented 8 years ago

Oops, thanks for catching that.

pluma commented 8 years ago

The problem seems to be that the client logic is the same as with the regular collection API but the actual HTTP API behaves differently. Not sure what the point of that is (the graph API was implemented later and in JS so it's probably unintentional), but we should probably unify the behaviour in the client.

sylvainlap commented 8 years ago

Shouldn't be the REST API to be unified ?

pluma commented 8 years ago

Maybe, but that wouldn't be a backwards compatible change, so it probably would not happen before ArangoDB 4.0.

janwo commented 7 years ago

I have the same problem right now. Will this getting fixed soon? Or is there a workaround as long as this behavior persists. Docs say that it should actually return the document itself.

pluma commented 6 years ago

This has been addressed in the development version and will be fixed in the upcoming arangojs 6.0.0.