Documentation
¶
Overview ¶
Package generate provides the schema codegen engine for nself generate.
It fetches the live Hasura GraphQL schema via introspection, parses it into an internal IR (tables, enums, relationships, operations), and renders type-safe client code for TypeScript, Dart, Swift, Kotlin, and Python.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GenerateSummary ¶
GenerateSummary reports counts for the diff summary line.
func Render ¶
func Render(ir *IR, opts RenderOptions) ([]GenerateSummary, error)
Render generates all requested language outputs to outDir. It returns one GenerateSummary per language processed.
type IR ¶
type IR struct {
SchemaName string
GeneratedAt string
Tables []IRTable
Enums []IREnum
Operations []IROperation
Package string // used by Kotlin renderer
}
IR is the internal representation of the parsed schema. It is language-agnostic and is consumed by per-language renderers.
type IRColumn ¶
type IRColumn struct {
Name string // camelCase field name
OrigName string // original snake_case name
Nullable bool
// Per-language types
TSType string
DartType string
SwiftType string
KotlinType string
PythonType string
}
IRColumn is one field on a table.
type IROperation ¶
type IROperation struct {
Name string // PascalCase name
ConstName string // camelCase const (TS), variable name (others)
Kind string // query | mutation | subscription
Document string // raw GraphQL text
Variables []IRColumn
ResultFields []IRColumn
}
IROperation is one .graphql operation (query / mutation / subscription).