Skip to content

Commit

Permalink
update mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahschwartz committed Jan 29, 2024
1 parent 4095f08 commit 4215861
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 19 deletions.
67 changes: 48 additions & 19 deletions docs/reference/mutations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,86 +3,113 @@ title: Mutations
category: Reference
---

{/*TODO: Finish this mutation*/}

# Mutations

## `startSession`

**args:**

`id`: `ID!`

returns `Boolean!`
Initialize a new debugger session, returning its `ID`.
A new VM instance is spawned for each session.
The session is run in a separate database transaction,
on top of the most recent node state.

## `endSession`

End a debugger session.
Returns a `Boolean!` indicating whether the session was successfully ended.

**args:**

`id`: `ID!`

returns `Boolean!`
The session ID.

## `reset`

Reset the VM instance to the initial state.
Returns a `Boolean!` indicating whether the VM instance was successfully reset.

**args:**

`id`: `ID!`

returns `Boolean!`
The session ID.

## `execute`

Execute a single `fuel-asm` instruction.
Returns a `Boolean!` indicating whether the instruction was successfully executed.

**args:**

`id`: `ID!`

The session ID.

`op`: `String!`

returns `Boolean!`
The `fuel-asm` instruction to execute.

## `setSingleStepping`

Set single-stepping mode for the VM instance.
Returns a `Boolean!` indicating whether the mutation successfully executed.

**args:**

`id`: `ID!`

The session ID.

`enable`: `boolean`

returns `Boolean!`
Whether to enable single-stepping mode.

## `setBreakpoint`

Set a breakpoint for a VM instance.
Returns a `Boolean!` indicating whether the breakpoint was successfully set.

**args:**

`id`: `ID!`

The session ID.

`breakpoint`: [`Breakpoint!`](/docs/reference/objects/#breakpoint)

returns `Boolean!`
The breakpoint to set.

## `startTx`

Run a single transaction in given session until it hits a breakpoint or completes.
Returns a `RunResult!`.

**args:**

`id`: `ID!`

The session ID.

`txJson`: `String!`

returns `RunResult!`
The transaction JSON string.

## `continueTx`

Resume execution of the VM instance after a breakpoint.
Runs until the next breakpoint or until the transaction completes.
Returns a `RunResult!`.

**args:**

`id`: `ID!`

returns `RunResult!`
The session ID.

## `dryRun`

A mutation that spins up a new temporary node from the current state and emulates a given transaction.
It returns a [`[Receipt!]!`](/docs/reference/objects/#receipt) for the emulated transaction.
Spin up a new temporary node from the current state and emulate a given transaction.
Returns a [`[Receipt!]!`](/docs/reference/objects/#receipt) for the emulated transaction.
You can optionally use UTXO validation.

**args:**
Expand All @@ -91,12 +118,13 @@ You can optionally use UTXO validation.

The transaction hex string.

`utxoValidation`: `Boolean`:
`utxoValidation`: `Boolean`
Whether or not to use UTXO validation.

## `produceBlocks`

A mutation that produces blocks, that can be used for testing that requires block advancement. Returns a [`U32!`](/docs/reference/scalars/#u32).
Produce blocks that can be used for testing that requires block advancement.
Returns a [`U32!`](/docs/reference/scalars/#u32).

**args:**

Expand All @@ -110,7 +138,8 @@ The number of blocks to produce.

## `submit`

A mutation that submits transaction to the transaction pool and returns a [`Transaction!`](/docs/reference/objects/#transaction).
Submit a transaction to the transaction pool.
Returns a [`Transaction!`](/docs/reference/objects/#transaction).

**args:**

Expand Down
1 change: 1 addition & 0 deletions docs/reference/objects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ An array of transactions included in the block.
## `Breakpoint`

A breakpoint during debugging.
Defined as a tuple of a contract ID and relative `pc` offset inside it.

**fields:**

Expand Down

0 comments on commit 4215861

Please sign in to comment.