tonco_api_client
Low-level GraphQL wrapper for the Tonco Indexer API.
Use this crate when an application needs to execute Tonco GraphQL queries while
keeping query files, generated query modules, schema refreshes, pagination, and
domain mapping in the application layer. The crate intentionally exposes
client.graphql.exec(operation_name, query) instead of higher-level pool or
swap APIs.
Usage
[]
= "0.2"
= { = "1", = ["derive"] }
= { = "1", = ["macros", "rt-multi-thread"] }
The minimum supported Rust version (MSRV) is 1.88.
Run requests inside an async Tokio runtime. client.graphql.exec sends the
x-apollo-operation-name header, unwraps GraphQL data, and maps GraphQL
errors or missing data to ApiClientsError::UnexpectedResponse.
use ;
use ToncoApiClient;
;
# async
For larger applications, prefer generated query types from graphql_client.
Keep schema and query paths relative to the consuming application crate:
use GraphQLQuery;
;
The checked-in src/graphql_schema.json, tests/pools.graphql, and
tests/test_graphql.rs files show the repository's live-test setup. Application
crates should own their own query files and schema update workflow.
Public client types are marked #[non_exhaustive] where applicable for semver
headroom. The default endpoint intentionally has no trailing slash:
https://indexer.tonco.io. Adding a trailing slash can produce POST //
against the live service.