introspection

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

introspection implements the spec defined in https://github.com/facebook/graphql/blob/master/spec/Section%204%20--%20Introspection.md#schema-introspection

Index

Constants

View Source
const Query = `` /* 1436-byte string literal not displayed */

https://github.com/graphql/graphql-js/blob/main/src/utilities/getIntrospectionQuery.js

Variables

View Source
var ErrNotFoundTypes = errors.New("not found types")

Functions

This section is empty.

Types

type Arg

type Arg struct {
	Name              string  `json:"name"`
	Description       string  `json:"description"`
	Type              *Type   `json:"type"`
	DefaultValue      *string `json:"defaultValue"`
	IsDeprecated      bool    `json:"isDeprecated"`
	DeprecationReason string  `json:"deprecationReason"`
}

func (*Arg) String

func (a *Arg) String() string

type Args

type Args []*Arg

func (Args) String

func (a Args) String() string

String concatenates the elements of its first argument to create a single element. The separator

type Directive added in v0.0.4

type Directive struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Locations   []string `json:"locations"`
	Args        Args     `json:"args"`
}

func (*Directive) String added in v0.0.4

func (d *Directive) String() string

type EnumValue

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

func (*EnumValue) String

func (e *EnumValue) String() string

type Field

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

func (*Field) String

func (f *Field) String() string

type InputValue

type InputValue struct {
	Name              string  `json:"name"`
	Description       string  `json:"description"`
	Type              *Type   `json:"type"`
	DefaultValue      *string `json:"defaultValue"`
	IsDeprecated      bool    `json:"isDeprecated"`
	DeprecationReason string  `json:"deprecationReason"`
}

func (*InputValue) String

func (i *InputValue) String() string

type OperationType

type OperationType struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Kind        string `json:"kind"`
}

type Root

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

type Schema

type Schema struct {
	QueryType        *OperationType `json:"queryType"`
	MutationType     *OperationType `json:"mutationType"`
	SubscriptionType *OperationType `json:"subscriptionType"`
	Types            []*Types       `json:"types"`
	Directives       []*Directive   `json:"directives"`
	// contains filtered or unexported fields
}

func (*Schema) FindTypes

func (s *Schema) FindTypes(typName string) (*Types, error)

func (*Schema) String

func (s *Schema) String() string

func (*Schema) UnmarshalJSON added in v0.0.2

func (s *Schema) UnmarshalJSON(data []byte) error

type Type

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

func (*Type) String

func (t *Type) String() string

func (*Type) UnderlyingKind

func (t *Type) UnderlyingKind() TypeKind

func (*Type) UnderlyingName

func (t *Type) UnderlyingName() string

type TypeKind

type TypeKind string

https://github.com/graphql/graphql-js/blob/540f33605ee047ab86e0d9666f4a60526d56ff0f/src/type/introspection.js#L427-L436

const (
	SCALAR       TypeKind = "SCALAR"
	OBJECT       TypeKind = "OBJECT"
	INTERFACE    TypeKind = "INTERFACE"
	UNION        TypeKind = "UNION"
	ENUM         TypeKind = "ENUM"
	INPUT_OBJECT TypeKind = "INPUT_OBJECT"
	LIST         TypeKind = "LIST"
	NON_NULL     TypeKind = "NON_NULL"
)

type Types

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

func (*Types) IsOperationType

func (t *Types) IsOperationType() bool

func (*Types) String

func (t *Types) String() string

func (*Types) UnmarshalJSON added in v0.0.2

func (t *Types) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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