Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Beta 5 Schema Updates #27

Merged
merged 13 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,18 @@ jobs:
npm install
npm run lint:docs:check

check-coverage:
name: Check Coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
# RUN COVERAGE CHECK
- name: Coverage Check
run: |
npm install
node scripts/coverage/index.mjs


8 changes: 3 additions & 5 deletions docs/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ The playground is an interactive and graphical IDE that includes a reference for

You can test out the Fuel GraphQL API playground here:

Beta-4:
https://beta-4.fuel.network/playground
https://beta-5.fuel.network/playground

## API Endpoint
## RPC Endpoint

Beta-4:
https://beta-4.fuel.network/graphql
https://beta-5.fuel.network/graphql
6 changes: 3 additions & 3 deletions docs/querying-from-a-dapp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This section covers just a few options available to get you started.

```javascript
export async function getHealth() {
let response = await fetch('https://beta-4.fuel.network/graphql', {
let response = await fetch('https://beta-5.fuel.network/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Expand All @@ -36,7 +36,7 @@ npm install @apollo/client graphql
import { ApolloClient, InMemoryCache, gql } from '@apollo/client';

const apolloClient = new ApolloClient({
uri: 'https://beta-4.fuel.network/graphql',
uri: 'https://beta-5.fuel.network/graphql',
cache: new InMemoryCache(),
});

Expand Down Expand Up @@ -66,7 +66,7 @@ npm install urql graphql
import { Client, cacheExchange, fetchExchange } from 'urql';

const urqlClient = new Client({
url: 'https://beta-4.fuel.network/graphql',
url: 'https://beta-5.fuel.network/graphql',
exchanges: [cacheExchange, fetchExchange],
});

Expand Down
6 changes: 3 additions & 3 deletions docs/recipes.mdx
sarahschwartz marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ query Transactions($address: Address) {
}
}
... on InputMessage {
messageId
nonce
sender
recipient
amount
Expand Down Expand Up @@ -199,7 +199,7 @@ query LatestTransactions {
}
}
... on InputMessage {
messageId
nonce
sender
recipient
amount
Expand Down Expand Up @@ -349,7 +349,7 @@ query LatestBlocks {
}
}
... on InputMessage {
messageId
nonce
sender
recipient
amount
Expand Down
23 changes: 23 additions & 0 deletions docs/reference/enums.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ category: Reference

# Enums

## `MessageState`

The state of a message.
sarahschwartz marked this conversation as resolved.
Show resolved Hide resolved

`UNSPENT`:
The message is unspent.

`SPENT`:
The message is spent.

`NOT_FOUND`:
The message was not found.

## `ReceiptType`

The receipt type indicating what kind of transaction generated the receipt.
Expand Down Expand Up @@ -60,3 +73,13 @@ Indicates the transaction returned some data.

`REVERT`:
Indicates the transaction reverted.

## `RunState`

The state of a [`RunResult`](/docs/reference/objects/#runresult).

`COMPLETED`:
All breakpoints have been processed, and the program has terminated.

`BREAKPOINT`:
The program stopped on a breakpoint.
121 changes: 112 additions & 9 deletions docs/reference/mutations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,128 @@ category: Reference

# Mutations

## `startSession`
sarahschwartz marked this conversation as resolved.
Show resolved Hide resolved

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!`

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!`

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!`

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`

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)

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!`

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!`

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.

### `dryRun` `args`
**args:**

`tx`: [`HexString!`](/docs/reference/scalars/#hexstring)

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).

### `produceBlocks` `args`
**args:**

`startTimestamp`: [`Tai64Timestamp!`](/docs/reference/scalars/#tai64timestamp)

Expand All @@ -36,10 +138,11 @@ 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).

### `submit` `args`
**args:**

`tx:` [`HexString!`](/docs/reference/scalars/#hexstring)
`tx`: [`HexString!`](/docs/reference/scalars/#hexstring)

The transaction hex string.
Loading
Loading