# Khan/genqlient

a truly type-safe Go GraphQL client

Repository: https://github.com/Khan/genqlient
Canonical: https://ross.abutalabs.com/products/genqlient
Language: Go
License: MIT
License Family: permissive
Topics: graphql, go, golang, codegen
Last push: 2026-08-25T02:26:40+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 99, release rhythm 16, longevity 100
- inputs: {"age_days": 2421, "days_push": 9, "days_rel": 472, "gap_med": 104, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1320, forks 143 (observed 2026-08-28T04:04:21.768614+00:00)

## What it is
genqlient is a Go library and code generator that produces type-safe client code for GraphQL APIs. It validates queries against the schema at compile time and generates strongly typed response and variable structs, eliminating boilerplate and runtime type errors.

## Use cases
- generate type-safe Go clients for a GraphQL API
- validate GraphQL queries at compile time in Go
- avoid interface{} when unmarshaling GraphQL responses in Go
- set up GraphQL codegen for a Go backend service
- query a GraphQL schema with typed variables and responses

## When to choose
- you write Go against a GraphQL API and want compile-time query validation
- you want generated, strongly typed response structs instead of manual structs or interface{}
- you want a production-proven GraphQL client used at scale

## When to avoid
- your project is not in Go
- you prefer runtime GraphQL clients without a codegen step
- you only make a few simple queries where codegen overhead isn't worth it

## Facets
- artifact type: library
- maturity: active
- function: graphql, graphql-client, serialization, developer-tools
- domain: web-development, apis, developer-tools, backend
- platform: go, cli, cross-platform
- tags: codegen, type-safety, graphql-client, go-library

## Member repositories
- Khan/genqlient (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:21.768614+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:47:24.959586+00:00, confidence not recorded.
  - readme: https://github.com/Khan/genqlient (fetched 2026-08-28T04:04:21.768614+00:00, sha 9810f51229d3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
