@dgql/builder
DGQL Query Builder.
Getting Started
$ npm install @dgql/builder
Quick Start
const { Builder, node, property, edge } = require("@dgql/builder");
const builder = new Builder();
const [dgql, variables] = builder
.match({
user: node({ label: "User" })
.where({ name: property({ equal: "Dan" }) })
.project({
id: property(),
name: property(),
posts: edge({
type: "HAS_POST",
direction: "OUT",
node: node({ label: "Post" }),
}).project({
title: property(),
}),
}),
})
.return(["user"])
.build();
console.log(dgql);
Usage
For the best view browse the TCK tests
Licence
MIT