solana-web3.js
solana-web3.js copied to clipboard
Add support for slot-based nested GraphQL queries
Motivation
We could go completely bananas with the GraphQL schema, and allow block
queries anywhere there's a slot
in a response.
Similar to how we've replaced any address
fields with a queryable account
, we can do the same for any slot
fields, allowing even more query-chaining!
Details
It's actually pretty easy to implement, it would just require some minor redundancy for slot
other than just being a bigint
. This would behave exactly like account
, where we're inserting address
and only requesting the RPC if any other field is queried.
query myQuery {
slot {
slot
}
}