Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

tractorbeam mutation

The Tractorbeam API's mutation operations.

tractorbeam mutation <subcommand> [flags]

Shared flags

Every subcommand takes these flags.

Flag Description
--config <string> The Project’s tractorbeam.config.ts. Defaults to the one in the current directory or its nearest ancestor.
--workspace <string> Workspace name. Environment variable: TRACTORBEAM_WORKSPACE.
--origin <string> The Tractorbeam origin to call instead of the default, such as a proxy’s. Environment variable: TRACTORBEAM_ORIGIN.
--token <string> Access token. Defaults to the saved interactive session. Environment variable: TRACTORBEAM_TOKEN.

mutation list

Returns the Mutations the Branch’s HEAD, or a retained Commit on it, selects, each with its input’s and result’s schemas and the Tables it reads or writes. Needs Workspace authority; an App token can’t list Mutations.

tractorbeam mutation list [flags]
Flag Description
--at-commit-id <string> The ID of a retained Commit on the Branch to read at. Defaults to the Branch’s HEAD.
--branch <string> Branch name. Defaults to the Branch you last switched to, or main. Environment variable: TRACTORBEAM_BRANCH.

mutation get

Returns the Mutation with this name selected by the Branch’s HEAD or by a retained Commit on it, with its input’s and result’s schemas and the Tables it reads or writes. Returns 404 when none is selected. Needs Workspace authority; an App token can’t retrieve Mutations.

tractorbeam mutation get [flags] <mutation>
Argument Description
<mutation> The name of the Mutation to retrieve.
Flag Description
--at-commit-id <string> The ID of a retained Commit on the Branch to read at. Defaults to the Branch’s HEAD.
--branch <string> Branch name. Defaults to the Branch you last switched to, or main. Environment variable: TRACTORBEAM_BRANCH.

mutation invoke

Runs the Mutation against the Branch’s HEAD and commits its writes as one Commit, then returns the Commit and the Mutation’s result. When a Commit written to the Branch first changes what the Mutation read, Tractorbeam runs the Mutation again on the new HEAD. After the call has conflicted for longer than its time limit, it returns 409. When the Mutation throws, it commits nothing. Needs mutations:invoke. An App token can invoke the Mutations its App selects.

tractorbeam mutation invoke [flags] <mutation>
Argument Description
<mutation> The name of the Mutation to call.
Flag Description
--branch <string> Branch name. Defaults to the Branch you last switched to, or main. Environment variable: TRACTORBEAM_BRANCH.
--input <json> The Mutation’s input. A bound Mutation’s input names its Object’s ID as object.
--json <json> The body’s fields as one JSON object. Flags given as well override its fields.