codegen

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(schema *Schema, directory string) error

Types

type EnumValue

type EnumValue struct {
	Name string `json:"name"`
}

type Field

type Field struct {
	Name string  `json:"name"`
	Type TypeRef `json:"type"`
	Args []Input `json:"args"`
}

type Input

type Input struct {
	Name         string  `json:"name"`
	Type         TypeRef `json:"type"`
	DefaultValue *string `json:"defaultValue"`
}

type RootType

type RootType struct {
	Name string `json:"name"`
}

type Schema

type Schema struct {
	QueryType        *RootType `json:"queryType"`
	MutationType     *RootType `json:"mutationType"`
	SubscriptionType *RootType `json:"subscriptionType"`
	Types            []Type    `json:"types"`
}

func FetchSchema

func FetchSchema(ctx context.Context) (*Schema, error)

func ParseSchema

func ParseSchema(reader io.Reader) (*Schema, error)

type Type

type Type struct {
	Kind          string      `json:"kind"`
	Name          string      `json:"name"`
	Fields        []Field     `json:"fields"`
	InputFields   []Input     `json:"inputFields"`
	EnumValues    []EnumValue `json:"enumValues"`
	PossibleTypes []TypeRef   `json:"possibleTypes"`
}

type TypeRef

type TypeRef struct {
	Kind   string   `json:"kind"`
	Name   string   `json:"name"`
	OfType *TypeRef `json:"ofType"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL