Gurafi

Rust crates for building GraphQL servers.

gurafi is a type-safe, code-first GraphQL stack for Rust. Rust types describe the schema, #[derive] macros provide the wiring, and the resulting gql::Schema is a normal GraphQL schema that can be executed directly or served over HTTP.

The documentation follows a progressive learning path: start with a schema and a query, then add models, fields, arguments and context. Each concept is expressed with Rust types, builder methods and derives rather than with generated resolver types.

Start here

  • Getting started — install the crates, build a schema, run a query
  • Objects — turn application data into GraphQL object types
  • Fields — resolvers, lists, nullability, exposure and field options
  • Using args — typed arguments from Rust structs
  • Using context — request state shared by every resolver

Guide

Plugins and extensions

Server

Reference

  • Architecture — how gql, gurafi, gurafi-relay and suku fit together
  • Schema evolution — compatibility diffing, SDL snapshots, composition

Crates

CrateRole
gqlGraphQL specification: parser, validation, execution, introspection
gurafiRust-first schema builder and type-safe DX
gurafi-macrosDerives for Object, Args, Input, Enum, Scalar, Union, ErrorUnion
gurafi-relayRelay global IDs, Node, connections and mutation payloads
sukuGraphQL over HTTP, batching, SSE subscriptions and error masking

The crates are deliberately independent: gql knows nothing about HTTP or Rust models, gurafi builds only on the public gql API, and suku only understands gql::Schema.