pub struct BlockQueryInput {
pub block_height_gte: Option<i32>,
pub block_height_lt: Option<i32>,
pub date_time_gte: Option<String>,
pub date_time_lt: Option<String>,
pub canonical: Option<bool>,
pub in_best_chain: Option<bool>,
}Expand description
Filter blocks by height, date, or canonical status.
GraphQL Int is signed 32-bit, so the block-height bounds are i32.
A height computed from a u64 now fails to compile instead of coming back
as a runtime GraphQL validation error. Output heights stay i64 — widening
an output is safe and the server already sends values as Int.
Fields§
§block_height_gte: Option<i32>§block_height_lt: Option<i32>§date_time_gte: Option<String>Inclusive lower bound, as an ISO-8601 / RFC 3339 instant.
The server coerces this with JavaScript’s new Date(value).getTime().
A value it cannot parse becomes NaN, which reaches SQL as the literal
string "NaN" and matches nothing without erroring — the query
returns HTTP 200 and an empty list. "14/08/2023" fails this way;
"Aug 14 2023" parses but depends on the server’s local timezone.
Prefer BlockQueryInput::date_time_gte_from_unix_ms, which cannot
express an unparseable value.
date_time_lt: Option<String>Exclusive upper bound, as an ISO-8601 / RFC 3339 instant.
Carries the same silent-empty-result hazard as
BlockQueryInput::date_time_gte. Prefer
BlockQueryInput::date_time_lt_from_unix_ms.
canonical: Option<bool>§in_best_chain: Option<bool>Implementations§
Source§impl BlockQueryInput
impl BlockQueryInput
Sourcepub fn date_time_gte_from_unix_ms(self, ms: i64) -> Self
pub fn date_time_gte_from_unix_ms(self, ms: i64) -> Self
Set the inclusive lower bound from Unix epoch milliseconds.
Formats to ISO-8601 with a Z offset, which the server always parses
to a finite number — so this cannot produce the silent empty result
that a hand-written date string can.
Sourcepub fn date_time_lt_from_unix_ms(self, ms: i64) -> Self
pub fn date_time_lt_from_unix_ms(self, ms: i64) -> Self
Set the exclusive upper bound from Unix epoch milliseconds.