codegen

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Schema       []string               `yaml:"schema"`
	Client       ConfigClient           `yaml:"client"`
	TypeMappings map[string]TypeMapping `yaml:"typeMappings"`

	SkipGofmt        bool `yaml:"skipGofmt"`
	CreateSchemaYaml bool `yaml:"createSchemaYaml"`
}

type ConfigClient

type ConfigClient struct {
	Dir     string
	Package string
}

type Generator

type Generator struct {
	Config Config
	Schema Schema
	// contains filtered or unexported fields
}

func New

func New(configLocationPath, filename string) (*Generator, error)

func (*Generator) Generate

func (gen *Generator) Generate() error

type Schema

type Schema struct {
	Functions []SchemaFunction
	Types     []SchemaType
}

type SchemaFunction

type SchemaFunction struct {
	Name string
	// QueryType is graphql type [query, mutation]
	QueryType   string
	Description string

	Type      SchemaType
	Arguments map[string]SchemaType
}

type SchemaType

type SchemaType struct {
	Name        string
	Type        string
	NonNull     bool
	Description string
	Kind        string

	List        bool
	ListNonNull bool

	Fields map[string]SchemaType
}

type TypeMapping added in v0.6.0

type TypeMapping struct {
	Alias  *string `yaml:"alias"`
	Import *string `yaml:"import"`
	Name   string  `yaml:"name"`
}

Jump to

Keyboard shortcuts

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