graphql

package
v0.0.0-...-94071ed Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument struct {
	Name    string      `json:"name"`
	Type    Input       `json:"type"`
	About   string      `json:"description"`
	Default interface{} `json:"defaultValue"`
}

Argument Input of the Field

type Field

type Field struct {
	// Name of the Field
	Name string
	// OPTIONAL. Formal Arguments
	Args []*Argument
	// Type of the Field
	Type Output
	// OPTIONAL. Nested Fields of the Object Type.
	Fields
}

GraphQL *like Field Descriptor

type FieldQ

type FieldQ struct {
	// Field Descriptor
	*Field
	// Optional. Actual Arguments
	Args map[string]any
	// Nested Fields query
	Fields []*FieldQ
}

Field[Q]uery Arguments

func InputFields

func InputFields(schema Fields, query string) ([]*FieldQ, error)

InputFields parses ?fields=a.arg(val),b{c,d{e}} query string

type Fields

type Fields map[string]*Field

GraphQL *like set of the Object's Fields

type Input

type Input interface {
	Type
	DecodeValue(src any) (any, error)
}

Input Type

func List

func List(typeOf Input) Input

func NotNull

func NotNull(typeOf Input) Input

type Int32

type Int32 struct{}

func (Int32) DecodeValue

func (Int32) DecodeValue(src any) (any, error)

func (Int32) Name

func (Int32) Name() string

type Int64

type Int64 struct{}

func (Int64) DecodeValue

func (Int64) DecodeValue(src any) (any, error)

func (Int64) Name

func (Int64) Name() string

type Output

type Output interface {
}

Output Type

type String

type String struct{}

func (String) DecodeValue

func (String) DecodeValue(src any) (any, error)

func (String) Name

func (String) Name() string

type Type

type Type interface {
	Name() string
}

type Uint32

type Uint32 struct{}

func (Uint32) DecodeValue

func (Uint32) DecodeValue(src any) (any, error)

func (Uint32) Name

func (Uint32) Name() string

Jump to

Keyboard shortcuts

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