Skip to content

Commit

Permalink
feat: add Application model and related pagination support in GraphQL
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhilt committed Feb 6, 2025
1 parent 2e3dfe8 commit 2f857f9
Show file tree
Hide file tree
Showing 4 changed files with 1,865 additions and 109 deletions.
59 changes: 59 additions & 0 deletions api/reader.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ type Input {
blockTimestamp: BigInt

prevRandao: String

"The application that produced the input"
application: Application!

"Get applications associated with the input with support for pagination"
applications(first: Int, last: Int, after: String, before: String): AppConnection!
}

type Application {
"Application ID"
id: String!
"Application name"
name: String!
"Application Address"
address: String!
}

"Representation of a transaction that can be carried out on the base layer blockchain, such as a transfer of assets"
Expand All @@ -76,6 +91,9 @@ type Voucher {

"The hash of executed transaction"
transactionHash: String

"The application that produced the voucher"
application: Application!
}

type DelegateCallVoucher {
Expand All @@ -95,6 +113,9 @@ type DelegateCallVoucher {

"The hash of executed transaction"
transactionHash: String

"The application that produced the delegateed voucher"
application: Application!
}

"Top level queries"
Expand All @@ -117,6 +138,8 @@ type Query {
notices(first: Int, last: Int, after: String, before: String): NoticeConnection!
"Get reports with support for pagination"
reports(first: Int, last: Int, after: String, before: String): ReportConnection!
"Get apps with support for pagination"
applications(first: Int, last: Int, after: String, before: String, where: AppFilter): InputConnection!
}

"Pagination entry"
Expand All @@ -137,6 +160,22 @@ type InputConnection {
pageInfo: PageInfo!
}

type AppConnection {
"Total number of entries that match the query"
totalCount: Int!
"Pagination entries returned for the current page"
edges: [AppEdge!]!
"Pagination metadata"
pageInfo: PageInfo!
}

type AppEdge {
"Node instance"
node: Application!
"Pagination cursor"
cursor: String!
}

"Pagination result"
type VoucherConnection {
"Total number of entries that match the query"
Expand Down Expand Up @@ -167,6 +206,9 @@ type Notice {
payload: String!
"Proof object that allows this notice to be validated by the base layer blockchain"
proof: Proof

"The application that produced the notice"
application: Application!
}

"Pagination entry"
Expand All @@ -187,6 +229,20 @@ type ReportConnection {
pageInfo: PageInfo!
}

"Filter object to restrict results depending on input properties"
input AppFilter {
"Filter only inputs with index lower than a given value"
indexLowerThan: Int
"Filter only inputs with index greater than a given value"
indexGreaterThan: Int

"Filter only apps with name"
name: String

"Filter only apps with address"
address: String
}

"Filter object to restrict results depending on input properties"
input InputFilter {
"Filter only inputs with index lower than a given value"
Expand Down Expand Up @@ -241,6 +297,9 @@ type Report {
input: Input!
"Report data as a payload in Ethereum hex binary format, starting with '0x'"
payload: String!

"The application that produced the report"
application: Application!
}

"Pagination entry"
Expand Down
Loading

0 comments on commit 2f857f9

Please sign in to comment.