transaction
The main mutation method, covers most of the modifications that can be done to the BaseHub’s schema with three different transaction types: create, update and delete.
Example
Check out our Mutation API Playground for full examples.
Create
When running the create transaction, you will need to pass two additional parameters: parentId
and data
.
The parentId
is the ID from the block where the creation will be done, could be any block, but that will affect which data structures are valid. In the example above, using that specific parentId
we cannot insert anything apart from instances, because collection children are always instances (or a component that works as template).
The data
field is the new block schema and values, including all its children.
Automatic Commit
The autoCommit
is an optional field that accepts any string
as the commit message that will be injected into the repository history. If not provided, the mutation updates will stay as work in progress (you will see them listed in your Changes Tab).