graphand-js
v0.30.16-beta
Published
Graphand-js is the javascript sdk to integrate efficiently graphand.io within your apps.
Downloads
205
Readme
Graphand javascript client
Graphand-js is the javascript sdk to integrate efficiently graphand.io within your apps.
Getting started
Create client
First, you need to create a graphand client for your project
import Graphand from "graphand-js";
const client = Graphand.createClient({
project: "yourProjectId"
});
Get model
Then, your client can generate GraphandModel constructor to access your data
const Account = client.getModel("Account");
const Potatoes = client.getModel("Data:potatoes");
// or get multiple models at once
const [Account, Potatoes] = client.getModels(["Account", "Data:potatoes"]);
Account.getCurrent().then((account) => alert(`Hello ${account.fullname} !`));
Potatoes.getList({}).then((list) => alert(`${list.count} potatoes in list !`));
See API reference
🚀