graphql

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareCustomData added in v0.0.38

func CompareCustomData(processor *codegen.Processor, cd1, cd2 *CustomData, existingChangeMap change.ChangeMap) *compareCustomData

func ParseRawCustomData added in v0.0.38

func ParseRawCustomData(processor *codegen.Processor, fromTest bool) ([]byte, error)

Types

type CustomClassInfo

type CustomClassInfo struct {
	Name          string `json:"name"`
	Exported      bool   `json:"exported"`
	DefaultExport bool   `json:"defaultExport"`
	Path          string `json:"path"`
}

type CustomData added in v0.0.38

type CustomData struct {
	Args       map[string]*CustomObject `json:"args,omitempty"`
	Inputs     map[string]*CustomObject `json:"inputs,omitempty"`
	Objects    map[string]*CustomObject `json:"objects,omitempty"`
	Interfaces map[string]*CustomObject `json:"interfaces,omitempty"`
	Unions     map[string]*CustomObject `json:"unions,omitempty"`
	// map of class to fields in that class
	Fields    map[string][]CustomField `json:"fields,omitempty"`
	Queries   []CustomField            `json:"queries,omitempty"`
	Mutations []CustomField            `json:"mutations,omitempty"`

	Classes     map[string]*CustomClassInfo `json:"classes,omitempty"`
	Files       map[string]*CustomFile      `json:"files,omitempty"`
	CustomTypes map[string]*CustomType      `json:"customTypes,omitempty"`
	Error       error                       `json:"-"`
	// contains filtered or unexported fields
}

type CustomEdge

type CustomEdge struct {
	SourceNodeName string
	EdgeName       string

	Type string
	// contains filtered or unexported fields
}

func (*CustomEdge) CamelCaseEdgeName

func (e *CustomEdge) CamelCaseEdgeName() string

func (*CustomEdge) GetEdgeName

func (e *CustomEdge) GetEdgeName() string

func (*CustomEdge) GetEntConfig

func (e *CustomEdge) GetEntConfig() *edge.EntConfigInfo

func (*CustomEdge) GetGraphQLConnectionName

func (e *CustomEdge) GetGraphQLConnectionName() string

func (*CustomEdge) GetGraphQLConnectionType added in v0.1.0

func (e *CustomEdge) GetGraphQLConnectionType() string

func (*CustomEdge) GetGraphQLEdgePrefix

func (e *CustomEdge) GetGraphQLEdgePrefix() string

func (*CustomEdge) GetNodeInfo

func (e *CustomEdge) GetNodeInfo() nodeinfo.NodeInfo

func (*CustomEdge) GetSourceNodeName

func (e *CustomEdge) GetSourceNodeName() string

func (*CustomEdge) GetTSGraphQLTypeImports

func (e *CustomEdge) GetTSGraphQLTypeImports() []*tsimport.ImportPath

func (*CustomEdge) GraphQLEdgeName

func (e *CustomEdge) GraphQLEdgeName() string

func (*CustomEdge) HideFromGraphQL

func (e *CustomEdge) HideFromGraphQL() bool

func (*CustomEdge) PolymorphicEdge

func (e *CustomEdge) PolymorphicEdge() bool

func (*CustomEdge) TsEdgeQueryEdgeName

func (e *CustomEdge) TsEdgeQueryEdgeName() string

func (*CustomEdge) TsEdgeQueryName

func (e *CustomEdge) TsEdgeQueryName() string

func (*CustomEdge) UniqueEdge

func (e *CustomEdge) UniqueEdge() bool

type CustomField

type CustomField struct {

	// for inline fields, it's empty since not defined anywhere
	Node         string          `json:"nodeName"`
	GraphQLName  string          `json:"gqlName"`
	FunctionName string          `json:"functionName"`
	Args         []CustomItem    `json:"args"`
	Results      []CustomItem    `json:"results"`
	FieldType    CustomFieldType `json:"fieldType"`
	Connection   bool            `json:"-"`
	EdgeName     string          `json:"edgeName"`
	Description  string          `json:"description,omitempty"`
	// extra imports
	ExtraImports []*tsimport.ImportPath `json:"extraImports,omitempty"`
	// To be used instead of calling a function...
	FunctionContents string `json:"functionContents,omitempty"`
	// contains filtered or unexported fields
}

func (*CustomField) UnmarshalJSON added in v0.1.0

func (cf *CustomField) UnmarshalJSON(data []byte) error

type CustomFieldType

type CustomFieldType string

CustomFieldType for a TypeScript class

const Accessor CustomFieldType = "ACCESSOR"

these values map to CustomFieldType enum in JS

const AsyncFunction CustomFieldType = "ASYNC_FUNCTION"
const Field CustomFieldType = "FIELD"
const Function CustomFieldType = "FUNCTION"

type CustomFile

type CustomFile struct {
	Imports map[string]*CustomImportInfo `json:"imports,omitempty"`
}

type CustomImportInfo

type CustomImportInfo struct {
	Path          string `json:"path,omitempty"`
	DefaultImport bool   `json:"defaultImport,omitempty"`
}

type CustomItem

type CustomItem struct {
	Name         string       `json:"name,omitempty"`
	Type         string       `json:"type,omitempty"`
	Nullable     NullableItem `json:"nullable,omitempty"`
	List         bool         `json:"list,omitempty"`
	Connection   bool         `json:"connection,omitempty"`
	IsContextArg bool         `json:"isContextArg,omitempty"`
	// indicates not to pass it to calling function
	GraphQLOnlyArg bool   `json:"graphQLOnlyArg,omitempty"`
	TSType         string `json:"tsType,omitempty"`

	Description string `json:"description,omitempty"`
	// contains filtered or unexported fields
}

type CustomObject

type CustomObject struct {
	NodeName    string   `json:"nodeName"`
	ClassName   string   `json:"className"`
	Description string   `json:"description,omitempty"`
	Interfaces  []string `json:"interfaces,omitempty"`
	UnionTypes  []string `json:"unionTypes,omitempty"`
}

type CustomScalarInfo added in v0.0.33

type CustomScalarInfo struct {
	Description    string `json:"description,omitempty"`
	Name           string `json:"name,omitempty"`
	SpecifiedByURL string `json:"specifiedByUrl,omitempty"`
}

type CustomType

type CustomType struct {
	Type       string `json:"type,omitempty"`
	ImportPath string `json:"importPath,omitempty"`

	// custom scalar info. used for schema.gql
	ScalarInfo *CustomScalarInfo `json:"scalarInfo,omitempty"`

	// both of these are optional
	TSType       string `json:"tsType,omitempty"`
	TSImportPath string `json:"tsImportPath,omitempty"`

	// if specified, graphql enum is generated for this...
	EnumMap map[string]string `json:"enumMap,omitempty"`

	// we need processed fields here
	StructFields []*input.Field `json:"structFields,omitempty"`

	// usually used with EnumMap to indicate if we're adding a new custom input enum where it should be placed
	InputType bool `json:"inputType,omitempty"`
}

type NullableItem

type NullableItem string
const NullableContents NullableItem = "contents"
const NullableContentsAndList NullableItem = "contentsAndList"
const NullableTrue NullableItem = "true"

type TSStep

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

func (*TSStep) Name

func (p *TSStep) Name() string

func (*TSStep) PostProcessData added in v0.0.38

func (p *TSStep) PostProcessData(processor *codegen.Processor) error

func (*TSStep) PreProcessData

func (p *TSStep) PreProcessData(processor *codegen.Processor) error

func (*TSStep) ProcessData

func (p *TSStep) ProcessData(processor *codegen.Processor) error

Jump to

Keyboard shortcuts

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