This library exposes a set of helpers to make building RQL transactions simpler.
@cubicweb/rql-generator is available from NPM:
# With NPM
npm i @cubicweb/rql-generator
# Or with Yarn
yarn add @cubicweb/rql-generator
This library works on an existing transaction object. This allows you to combine different helpers on the same object to create complex transactions.
Please refer to the documentation of
@cubicweb/client
on how to create the instanceSchema and client parameters.
import { Transaction } from "@cubicweb/client";
import {instanceSchema, client} from "../data"
const transaction = new Transaction()
const { resolveEntity } = pushEntityFromEid(transaction, instanceSchema, 5, "BlogEntry", [
"title",
"content"
]);
const result = await client.executeTransaction(transaction)
const entity = resolveEntity(result)
console.log(entity)
// Will print {title: "entity title", content: "entity content"}
You can find the full documentation with examples here.
All @cubicweb
libraries are in the cubicwebjs monorepo.
Please refer to the main README.
Contact us on Matrix and check the roadmap on the CubicWeb Repository.