0.2.7 • Published 7 years ago

dgraph-client v0.2.7

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

dgraph-client

A super simple, yet awesome client for dgraph using gRPC protocol.

Benefits:

  • Fast (gRPC)
  • no handling with NQuads, just set objects

Example

import DgraphClient from 'dgraph-client';

// create a new client
let client = new DgraphClient('localhost:8080');

// set objects
let me = {name: 'Paul', size: 1.85, time: Date.now()};
await client.set(me); 

// query objects
let me = await client.query(`query { me(id:${me._uid_}) { name, size } }`); 
// reponse is {me: {name: 'Paul', size: 1.85} } 

// set also works with geojson
let me = {name: 'Paul', location: {type: 'Point', coordinates: [13.25, 52.14]}};

await client.set(me);

// and with nested objects
let me = {name: 'Paul', friends: [{name: 'Max'}, {_uid_: "0xd8450668580bf30f"}]};
await client.set(me);
0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.15

7 years ago

0.1.14

7 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago