Skip to main content

Crate infrahub

Crate infrahub 

Source
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
ClientConfig
configuration for the infrahub client
EdgePage
a single page of connection results
GraphQlError
graphql error entry
GraphQlLocation
graphql error location
GraphQlResponse
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
BoxFutureResult
boxed future used by DynPaginator
DynPaginator
type-erased paginator for ergonomic API surfaces that cannot expose closure types.
Result
library result type