generator

package
v3.0.0-...-126ad84 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLayerTypeName

func NewLayerTypeName(base, thisField string) string

Types

type Argument

type Argument struct {
	Variable string
	Type     types.Type
}

type Fragment

type Fragment struct {
	Name string
	Type types.Type
}

type GenGettersGenerator

type GenGettersGenerator struct {
	// contains filtered or unexported fields
}

func NewGenGettersGenerator

func NewGenGettersGenerator(queryGenPackageName string) *GenGettersGenerator

func (*GenGettersGenerator) GenFunc

func (g *GenGettersGenerator) GenFunc() func(name string, p types.Type) string

type Operation

type Operation struct {
	Name                string
	VariableDefinitions ast.VariableDefinitionList
	Operation           string
	Args                []*Argument
	OperationResponse   *OperationResponse
}

func NewOperation

func NewOperation(operation *ast.OperationDefinition, queryDocument *ast.QueryDocument, args []*Argument, operationResponse *OperationResponse) *Operation

type OperationResponse

type OperationResponse struct {
	Name string
	Type types.Type
}

type ResponseField

type ResponseField struct {
	Name             string
	IsFragmentSpread bool
	IsInlineFragment bool
	Type             types.Type
	Tags             []string
	ResponseFields   ResponseFieldList
}

func (ResponseField) FieldTypeString

func (r ResponseField) FieldTypeString() string

type ResponseFieldList

type ResponseFieldList []*ResponseField

func (ResponseFieldList) IsBasicType

func (rs ResponseFieldList) IsBasicType() bool

func (ResponseFieldList) IsFragment

func (rs ResponseFieldList) IsFragment() bool

func (ResponseFieldList) IsFragmentSpread

func (rs ResponseFieldList) IsFragmentSpread() bool

func (ResponseFieldList) IsStructType

func (rs ResponseFieldList) IsStructType() bool

func (ResponseFieldList) MapByName

func (rs ResponseFieldList) MapByName() map[string]*ResponseField

func (ResponseFieldList) SortByName

func (rs ResponseFieldList) SortByName() ResponseFieldList

func (ResponseFieldList) StructType

func (rs ResponseFieldList) StructType() *types.Struct

type Source

type Source struct {
	// contains filtered or unexported fields
}

func NewSource

func NewSource(schema *ast.Schema, queryDocument *ast.QueryDocument, sourceGenerator *SourceGenerator) *Source

func (*Source) Fragments

func (s *Source) Fragments() ([]*Fragment, error)

func (*Source) OperationResponses

func (s *Source) OperationResponses() ([]*OperationResponse, error)

func (*Source) Operations

func (s *Source) Operations(queryDocuments []*ast.QueryDocument) ([]*Operation, error)

func (*Source) ResponseSubTypes

func (s *Source) ResponseSubTypes() []*StructSource

type SourceGenerator

type SourceGenerator struct {
	StructSources []*StructSource
	// contains filtered or unexported fields
}

func NewSourceGenerator

func NewSourceGenerator(cfg *config.Config) *SourceGenerator

func (*SourceGenerator) NewResponseField

func (r *SourceGenerator) NewResponseField(selection ast.Selection, typeName string) *ResponseField

func (*SourceGenerator) NewResponseFields

func (r *SourceGenerator) NewResponseFields(selectionSet ast.SelectionSet, typeName string) ResponseFieldList

func (*SourceGenerator) OperationArguments

func (r *SourceGenerator) OperationArguments(variableDefinitions ast.VariableDefinitionList) []*Argument

func (*SourceGenerator) OperationResponse

func (r *SourceGenerator) OperationResponse(selection ast.Selection) *OperationResponse

func (*SourceGenerator) Type

func (r *SourceGenerator) Type(typeName string) types.Type

The typeName passed as an argument to Type must be the name of the type derived from the parsed result, such as from a selection.

type StructGenerator

type StructGenerator struct {
	// contains filtered or unexported fields
}

func NewStructGenerator

func NewStructGenerator(responseFieldList ResponseFieldList) *StructGenerator

func (*StructGenerator) GetCurrentResponseFieldList

func (g *StructGenerator) GetCurrentResponseFieldList() ResponseFieldList

func (*StructGenerator) MergedStructSources

func (g *StructGenerator) MergedStructSources(sources []*StructSource) []*StructSource

type StructSource

type StructSource struct {
	Name string
	Type types.Type
}

Jump to

Keyboard shortcuts

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