Moved from GitHub dgraph-js/62
Posted by felixfbecker:
It seems like the API is purely a generated gRPC client. This makes it very unergonomic for JavaScript in many places:
- None of the classes have constructors. For example, I can’t pass the value directly to
new Value()
, instead I have to callvalue.setStringVal('abc')
. One would expect an API more around object literals rather than getter and setter methods - The API allows contradictory state. For example, what happens when I call both
setStringVal()
andsetIntVal()
? - Some methods are confusingly named - e.g.
setSetJson()
- There are no docblocks on any methods
- Some types are completely unclear how to use - e.g.
setGeoVal()
takes astring
or aUInt8Array
.