Skip to content
Snippets Groups Projects

Elois/gva sort

Merged Éloïs requested to merge elois/gva-sort into dev
15 files
+ 552
182
Compare changes
  • Side-by-side
  • Inline
Files
15
@@ -9,7 +9,12 @@ type Query {
@@ -9,7 +9,12 @@ type Query {
node: Node! @juniper(ownership: "owned")
node: Node! @juniper(ownership: "owned")
current: Block @juniper(ownership: "owned")
current: Block @juniper(ownership: "owned")
block(number: Int!): Block @juniper(ownership: "owned")
block(number: Int!): Block @juniper(ownership: "owned")
blocks(interval: BlockInterval, paging: Paging, step: Int = 1): [Block!]! @juniper(ownership: "owned")
blocks(
 
interval: BlockInterval,
 
paging: Paging,
 
step: Int = 1,
 
sortOrder: SortOrder = ASC
 
): BlocksPage! @juniper(ownership: "owned")
}
}
type Mutation {
type Mutation {
@@ -17,7 +22,7 @@ type Mutation {
@@ -17,7 +22,7 @@ type Mutation {
}
}
#################################
#################################
# Inputs
# Interval inputs
#################################
#################################
input BlockInterval {
input BlockInterval {
@@ -26,11 +31,24 @@ input BlockInterval {
@@ -26,11 +31,24 @@ input BlockInterval {
to: Int
to: Int
}
}
 
#################################
 
# Pagination inputs
 
#################################
 
input Paging {
input Paging {
pageNumber: Int # default value: 0
pageNumber: Int # default value: 0
pageSize: Int # default value: 50
pageSize: Int # default value: 50
}
}
 
#################################
 
# Sort inputs
 
#################################
 
 
enum SortOrder {
 
ASC
 
DESC
 
}
 
#################################
#################################
# NODE types
# NODE types
#################################
#################################
@@ -46,17 +64,31 @@ type Node {
@@ -46,17 +64,31 @@ type Node {
}
}
#################################
#################################
# Block type
# Blocks types
#################################
#################################
scalar DateTimeUtc @juniper(with_time_zone: false)
type BlocksPage {
 
blocks: [Block!]!
 
currentPageNumber: Int!
 
intervalFrom: Int!,
 
intervalTo: Int!,
 
lastPageNumber: Int!,
 
totalBlocksCount: Int!,
 
}
type Block {
type Block {
version: Int!
version: Int!
currency: String!
currency: String!
issuer: String!
issuer: String!
 
issuerName: String,
number: Int!
number: Int!
hash: String!,
hash: String!,
commonTime: DateTimeUtc!
commonTime: DateTimeUtc!
powMin: Int!
powMin: Int!
}
}
 
 
#################################
 
# Custom scalars
 
#################################
 
 
scalar DateTimeUtc @juniper(with_time_zone: false)
Loading