Technology · Protocol

GraphQL

A typed Rust client for a cloud GPU provider's GraphQL API.

FAFO CoreCloud GPU provider clientTyped Rust
Responses from a vendor's schema
typed results pass througherrors are parsed with their field paths
Each failure lands in its own type
  • ~2,400lines across the client, query and type modules

A typed client for a GPU provider

GraphQL appears in one place: the cloud GPU provider integration inside the provisioning layer of my execution substrate, FAFO Core and Function Forge. I have a typed Rust client for that provider's GraphQL API.

The client, across the provider's API
pod lifecycleGPU pricingdata centresnetwork volumesregistry authaccount balance
REST
GraphQL, typed

Pod lifecycle goes over the same provider's REST API; the GraphQL client remains in the crate.

I chose REST for the pod path where the provider's REST interface was simpler, instead of keeping GraphQL for its own sake.

This is a well-typed client against a vendor's schema, not GraphQL server or schema design.

Typed failures, bounded retry

GraphQL errors are parsed with their field paths and mapped to typed errors rather than matched as strings, so the provisioning layer can tell "no capacity" from "bad credentials" and react differently. Retry is bounded, with capped exponential backoff, rather than unbounded against a paid API.

Capped exponential backoff
first retrythe cap: waits stop growing, and retries stop