introspection

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeKindScalar      = TypeKind("SCALAR")
	TypeKindObject      = TypeKind("OBJECT")
	TypeKindInterface   = TypeKind("INTERFACE")
	TypeKindUnion       = TypeKind("UNION")
	TypeKindEnum        = TypeKind("ENUM")
	TypeKindInputObject = TypeKind("INPUT_OBJECT")
	TypeKindList        = TypeKind("LIST")
	TypeKindNonNull     = TypeKind("NON_NULL")
)
View Source
const (
	ScalarInt     = Scalar("Int")
	ScalarFloat   = Scalar("Float")
	ScalarString  = Scalar("String")
	ScalarBoolean = Scalar("Boolean")
)

Variables

View Source
var Query string

Query is the query generated by graphiql to determine type information

Functions

This section is empty.

Types

type EnumValue

type EnumValue struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	IsDeprecated      bool   `json:"isDeprecated"`
	DeprecationReason string `json:"deprecationReason"`
}

type Field

type Field struct {
	Name              string      `json:"name"`
	Description       string      `json:"description"`
	TypeRef           *TypeRef    `json:"type"`
	Args              InputValues `json:"args"`
	IsDeprecated      bool        `json:"isDeprecated"`
	DeprecationReason string      `json:"deprecationReason"`

	ParentObject *Type `json:"-"`
}

type InputValue

type InputValue struct {
	Name         string   `json:"name"`
	Description  string   `json:"description"`
	DefaultValue *string  `json:"defaultValue"`
	TypeRef      *TypeRef `json:"type"`
}

type InputValues

type InputValues []InputValue

func (InputValues) HasOptionals

func (i InputValues) HasOptionals() bool

type Response

type Response struct {
	Schema *Schema `json:"__schema"`
}

Response is the introspection query response

type Scalar

type Scalar string

type Schema

type Schema struct {
	QueryType struct {
		Name string `json:"name"`
	} `json:"queryType"`
	MutationType struct {
		Name string `json:"name"`
	} `json:"mutationType"`
	SubscriptionType struct {
		Name string `json:"name"`
	} `json:"subscriptionType"`

	Types Types `json:"types"`
}

func (*Schema) Mutation

func (s *Schema) Mutation() *Type

func (*Schema) Query

func (s *Schema) Query() *Type

func (*Schema) Subscription

func (s *Schema) Subscription() *Type

func (*Schema) Visit

func (s *Schema) Visit(handlers VisitHandlers) error

type Type

type Type struct {
	Kind        TypeKind     `json:"kind"`
	Name        string       `json:"name"`
	Description string       `json:"description,omitempty"`
	Fields      []*Field     `json:"fields,omitempty"`
	InputFields []InputValue `json:"inputFields,omitempty"`
	EnumValues  []EnumValue  `json:"enumValues,omitempty"`
}

type TypeKind

type TypeKind string

type TypeRef

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

func (TypeRef) IsList

func (r TypeRef) IsList() bool

func (TypeRef) IsObject

func (r TypeRef) IsObject() bool

func (TypeRef) IsOptional

func (r TypeRef) IsOptional() bool

func (TypeRef) IsScalar

func (r TypeRef) IsScalar() bool

type Types

type Types []*Type

func (Types) Get

func (t Types) Get(name string) *Type

type VisitFunc

type VisitFunc func(*Type) error

type VisitHandlers

type VisitHandlers struct {
	Scalar VisitFunc
	Object VisitFunc
	Input  VisitFunc
	Enum   VisitFunc
}

type Visitor

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

func (*Visitor) Run

func (v *Visitor) Run() error

Jump to

Keyboard shortcuts

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