Inputs
Inputs represent requests submitted to the application to advance its state.
1. Get Input by Index
Retrieve a specific input based on its identifier.
query getInput($inputIndex: Int!) {
input(index: $inputIndex) {
index
status
timestamp
msgSender
blockNumber
payload
}
}
Arguments
Name | Type | Description |
---|---|---|
inputIndex | Int | Index of the input to retrieve. |
Response Type
2. Get Inputs
Retrieve a list of inputs with support for pagination.
query inputs(
$first: Int
$last: Int
$after: String
$before: String
$where: InputFilter
) {
inputs(
first: $first
last: $last
after: $after
before: $before
where: $where
) {
edges {
node {
index
status
timestamp
msgSender
blockNumber
payload
}
}
pageInfo {
hasNextPage
hasPreviousPage
startCursor
endCursor
}
}
}
Arguments
Name | Type | Description |
---|---|---|
first | Int | Get at most the first n entries (forward pagination). |
last | Int | Get at most the last n entries (backward pagination). |
after | String | Get entries after the provided cursor (forward pagination). |
before | String | Get entries before the provided cursor (backward pagination). |
where | InputFilter | Filter criteria for inputs. |
Response Type
You cannot mix forward pagination (
first
,after
) with backward pagination (last
,before
) in the same query.The
where
argument allows you to filter inputs based theInputFilter
.When using
where
withafter
orbefore
, the filter is applied first, and then the pagination is applied to the filtered results.
3. Get Input Result
Retrieve the result of a specific input, including its associated notices, vouchers, and reports.
query getInputResult($inputIndex: Int!) {
input(index: $inputIndex) {
status
timestamp
msgSender
blockNumber
reports {
edges {
node {
index
input {
index
}
payload
}
}
}
notices {
edges {
node {
index
input {
index
}
payload
}
}
}
vouchers {
edges {
node {
index
input {
index
}
destination
payload
}
}
}
}
}
Arguments
Name | Type | Description |
---|---|---|
inputIndex | Int | Index of the input to retrieve. |
Response Type
Input
with nested connections for reports, notices, and vouchers.
Examples
Fetching a specific input:
query {
input(index: 5) {
index
status
timestamp
msgSender
blockNumber
payload
}
}Listing earlier(first 5) inputs:
query {
inputs(first: 5) {
edges {
node {
index
status
timestamp
msgSender
payload
}
}
pageInfo {
hasNextPage
endCursor
}
}
}Retrieving input results:
query {
input(index: 10) {
status
timestamp
notices {
edges {
node {
index
payload
}
}
}
vouchers {
edges {
node {
index
destination
payload
}
}
}
}
}Using pagination and filtering:
query {
inputs(first: 5, where: { indexLowerThan: 1 }) {
edges {
node {
index
status
timestamp
msgSender
payload
}
}
pageInfo {
hasNextPage
endCursor
}
}
}