Expand description
infrahub graphql client
this crate provides a small, typed client for the infrahub graphql api.
start with Client and ClientConfig, then use execute_raw or
execute for ad-hoc queries. for generated schema clients, use the
infrahub-codegen tool to build a separate crate.
§quick start
use infrahub::{Client, ClientConfig};
let client = Client::new(ClientConfig::new("http://localhost:8000", "token"))?;
let response = client
.execute_raw("{ InfrahubInfo { deployment_id version } }", None, None)
.await?;
println!("{:?}", response.data);§generated clients
use infrahub-codegen to generate a schema-specific crate, then use it
alongside this base client.
Structs§
- Client
- graphql client for infrahub
- Client
Config - configuration for the infrahub client
- Edge
Page - a single page of connection results
- Graph
QlError - graphql error entry
- Graph
QlLocation - graphql error location
- Graph
QlResponse - graphql response wrapper
- Paginator
- generic paginator for connection-style data
Enums§
- Error
- error type for client and codegen helpers
Traits§
- Operation
- graphql operation contract for generated types
Type Aliases§
- BoxExtract
- boxed extract callback used by
DynPaginator - BoxFetch
- boxed fetch callback used by
DynPaginator - BoxFuture
Result - boxed future used by
DynPaginator - DynPaginator
- type-erased paginator for ergonomic API surfaces that cannot expose closure types.
- Result
- library result type