Skip to content

Commit 4c826f9

Browse files
authored
graphql: specify Long input and output formats (#389)
* graphql: specify Long input and output formats * use Long instead of Int
1 parent d517f2b commit 4c826f9

File tree

2 files changed

+23
-19
lines changed

2 files changed

+23
-19
lines changed

graphql.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
"args": [],
273273
"type": {
274274
"kind": "SCALAR",
275-
"name": "Int",
275+
"name": "Long",
276276
"ofType": null
277277
},
278278
"isDeprecated": false,
@@ -495,7 +495,7 @@
495495
"args": [],
496496
"type": {
497497
"kind": "SCALAR",
498-
"name": "Int",
498+
"name": "Long",
499499
"ofType": null
500500
},
501501
"isDeprecated": false,
@@ -529,7 +529,7 @@
529529
"name": null,
530530
"ofType": {
531531
"kind": "SCALAR",
532-
"name": "Int",
532+
"name": "Long",
533533
"ofType": null
534534
}
535535
},
@@ -592,7 +592,7 @@
592592
"name": null,
593593
"ofType": {
594594
"kind": "SCALAR",
595-
"name": "Int",
595+
"name": "Long",
596596
"ofType": null
597597
}
598598
},
@@ -1127,7 +1127,7 @@
11271127
"name": null,
11281128
"ofType": {
11291129
"kind": "SCALAR",
1130-
"name": "Int",
1130+
"name": "Long",
11311131
"ofType": null
11321132
}
11331133
},
@@ -1226,7 +1226,7 @@
12261226
{
12271227
"kind": "SCALAR",
12281228
"name": "Long",
1229-
"description": "Long is a 64 bit unsigned integer.",
1229+
"description": "Long is a 64 bit unsigned integer. Input is accepted as either a JSON number or as a string.\nStrings may be either decimal or 0x-prefixed hexadecimal. Output values are all\n0x-prefixed hexadecimal.",
12301230
"fields": null,
12311231
"inputFields": null,
12321232
"interfaces": null,
@@ -1289,7 +1289,7 @@
12891289
"name": null,
12901290
"ofType": {
12911291
"kind": "SCALAR",
1292-
"name": "Int",
1292+
"name": "Long",
12931293
"ofType": null
12941294
}
12951295
},
@@ -1754,7 +1754,7 @@
17541754
"args": [],
17551755
"type": {
17561756
"kind": "SCALAR",
1757-
"name": "Int",
1757+
"name": "Long",
17581758
"ofType": null
17591759
},
17601760
"isDeprecated": false,
@@ -2067,7 +2067,7 @@
20672067
"args": [],
20682068
"type": {
20692069
"kind": "SCALAR",
2070-
"name": "Int",
2070+
"name": "Long",
20712071
"ofType": null
20722072
},
20732073
"isDeprecated": false,

schema.graphqls

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ type Block {
6767
TransactionCount is the number of transactions in this block. if
6868
transactions are not available for this block, this field will be null.
6969
"""
70-
transactionCount: Int
70+
transactionCount: Long
7171

7272
"""
7373
StateRoot is the keccak256 hash of the state trie after this block was processed.
@@ -130,7 +130,7 @@ type Block {
130130
OmmerCount is the number of ommers (AKA uncles) associated with this
131131
block. If ommers are unavailable, this field will be null.
132132
"""
133-
ommerCount: Int
133+
ommerCount: Long
134134

135135
"""
136136
Ommers is a list of ommer (AKA uncle) blocks associated with this block.
@@ -144,7 +144,7 @@ type Block {
144144
OmmerAt returns the ommer (AKA uncle) at the specified index. If ommers
145145
are unavailable, or the index is out of bounds, this field will be null.
146146
"""
147-
ommerAt(index: Int!): Block
147+
ommerAt(index: Long!): Block
148148

149149
"""
150150
OmmerHash is the keccak256 hash of all the ommers (AKA uncles)
@@ -163,7 +163,7 @@ type Block {
163163
transactions are unavailable for this block, or if the index is out of
164164
bounds, this field will be null.
165165
"""
166-
transactionAt(index: Int!): Transaction
166+
transactionAt(index: Long!): Transaction
167167

168168
"""Logs returns a filtered set of logs from this block."""
169169
logs(filter: BlockFilterCriteria!): [Log!]!
@@ -306,7 +306,7 @@ input FilterCriteria {
306306
"""Log is an Ethereum event log."""
307307
type Log {
308308
"""Index is the index of this log in the block."""
309-
index: Int!
309+
index: Long!
310310

311311
"""
312312
Account is the account which generated this log - this will always
@@ -324,7 +324,11 @@ type Log {
324324
transaction: Transaction!
325325
}
326326

327-
"""Long is a 64 bit unsigned integer."""
327+
"""
328+
Long is a 64 bit unsigned integer. Input is accepted as either a JSON number or as a string.
329+
Strings may be either decimal or 0x-prefixed hexadecimal. Output values are all
330+
0x-prefixed hexadecimal.
331+
"""
328332
scalar Long
329333

330334
type Mutation {
@@ -335,7 +339,7 @@ type Mutation {
335339
"""Pending represents the current pending state."""
336340
type Pending {
337341
"""TransactionCount is the number of transactions in the pending state."""
338-
transactionCount: Int!
342+
transactionCount: Long!
339343

340344
"""Transactions is a list of transactions in the current pending state."""
341345
transactions: [Transaction!]
@@ -422,7 +426,7 @@ type Transaction {
422426
Index is the index of this transaction in the parent block. This will
423427
be null if the transaction has not yet been mined.
424428
"""
425-
index: Int
429+
index: Long
426430

427431
"""
428432
From is the account that sent this transaction - this will always be
@@ -517,7 +521,7 @@ type Transaction {
517521
v: BigInt!
518522

519523
"""Envelope transaction support"""
520-
type: Int
524+
type: Long
521525
accessList: [AccessTuple!]
522526

523527
"""
@@ -532,4 +536,4 @@ type Transaction {
532536
this is equivalent to TxType || ReceiptEncoding.
533537
"""
534538
rawReceipt: Bytes!
535-
}
539+
}

0 commit comments

Comments
 (0)