introspection

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseTypeKindScalar      = ResponseTypeKind("SCALAR")
	ResponseTypeKindObject      = ResponseTypeKind("OBJECT")
	ResponseTypeKindInterface   = ResponseTypeKind("INTERFACE")
	ResponseTypeKindUnion       = ResponseTypeKind("UNION")
	ResponseTypeKindEnum        = ResponseTypeKind("ENUM")
	ResponseTypeKindInputObject = ResponseTypeKind("INPUT_OBJECT")
	ResponseTypeKindList        = ResponseTypeKind("LIST")
	ResponseTypeKindNonNull     = ResponseTypeKind("NON_NULL")
)
View Source
const (
	ScalarInt     = Scalar("Int")
	ScalarFloat   = Scalar("Float")
	ScalarString  = Scalar("String")
	ScalarBoolean = Scalar("Boolean")
)

Variables

View Source
var DirectiveLocations = dagql.NewEnum[DirectiveLocation](
	"QUERY",
	"MUTATION",
	"SUBSCRIPTION",
	"FIELD",
	"FRAGMENT_DEFINITION",
	"FRAGMENT_SPREAD",
	"INLINE_FRAGMENT",
	"VARIABLE_DEFINITION",
	"SCHEMA",
	"SCALAR",
	"OBJECT",
	"FIELD_DEFINITION",
	"ARGUMENT_DEFINITION",
	"INTERFACE",
	"UNION",
	"ENUM",
	"ENUM_VALUE",
	"INPUT_OBJECT",
	"INPUT_FIELD_DEFINITION",
)
View Source
var Query string
View Source
var TypeKinds = dagql.NewEnum[TypeKind](
	"SCALAR",
	"OBJECT",
	"INTERFACE",
	"UNION",
	"ENUM",
	"INPUT_OBJECT",
	"LIST",
	"NON_NULL",
)

Functions

func Install

func Install[T dagql.Typed](srv *dagql.Server)

Types

type Directive

type Directive struct {
	Name string

	Locations    []string
	Args         []*InputValue
	IsRepeatable bool
	// contains filtered or unexported fields
}

func (*Directive) Description

func (d *Directive) Description() string

func (*Directive) Type

func (d *Directive) Type() *ast.Type

func (*Directive) TypeDescription

func (d *Directive) TypeDescription() string

type DirectiveLocation

type DirectiveLocation string

func (DirectiveLocation) Decoder

func (l DirectiveLocation) Decoder() dagql.InputDecoder

func (DirectiveLocation) ToLiteral

func (l DirectiveLocation) ToLiteral() call.Literal

func (DirectiveLocation) Type

func (l DirectiveLocation) Type() *ast.Type

func (DirectiveLocation) TypeDescription

func (l DirectiveLocation) TypeDescription() string

type EnumValue

type EnumValue struct {
	Name string
	// contains filtered or unexported fields
}

func (*EnumValue) DeprecationReason

func (e *EnumValue) DeprecationReason() *string

func (*EnumValue) Description

func (e *EnumValue) Description() string

func (*EnumValue) IsDeprecated

func (e *EnumValue) IsDeprecated() bool

func (*EnumValue) Type

func (e *EnumValue) Type() *ast.Type

func (*EnumValue) TypeDescription

func (e *EnumValue) TypeDescription() string

type Field

type Field struct {
	Name string

	Type_ *Type
	Args  []*InputValue
	// contains filtered or unexported fields
}

func (*Field) DeprecationReason

func (f *Field) DeprecationReason() *string

func (*Field) Description

func (f *Field) Description() string

func (*Field) IsDeprecated

func (f *Field) IsDeprecated() bool

func (*Field) Type

func (f *Field) Type() *ast.Type

func (*Field) TypeDescription

func (f *Field) TypeDescription() string

type InputValue

type InputValue struct {
	Name string

	DefaultValue *string
	Type_        *Type
	// contains filtered or unexported fields
}

func (*InputValue) DeprecationReason

func (i *InputValue) DeprecationReason() *string

func (*InputValue) Description

func (i *InputValue) Description() string

func (*InputValue) IsDeprecated

func (i *InputValue) IsDeprecated() bool

func (*InputValue) Type

func (i *InputValue) Type() *ast.Type

func (*InputValue) TypeDescription

func (i *InputValue) TypeDescription() string

type Response

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

Response is the introspection query response

type ResponseDirective

type ResponseDirective struct {
	Name         string                      `json:"name"`
	Description  string                      `json:"description"`
	Locations    []ResponseDirectiveLocation `json:"locations"`
	Args         []ResponseInputValue        `json:"args"`
	IsRepeatable bool                        `json:"isRepeatable"`
}

type ResponseDirectiveLocation

type ResponseDirectiveLocation string

type ResponseEnumValue

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

type ResponseField

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

	ParentObject *Type `json:"-"`
}

type ResponseInputValue

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

type ResponseInputValues

type ResponseInputValues []ResponseInputValue

func (ResponseInputValues) HasOptionals

func (i ResponseInputValues) HasOptionals() bool

type ResponseNamedType

type ResponseNamedType struct {
	Name string `json:"name"`
}

type ResponseSchema

type ResponseSchema struct {
	QueryType        ResponseNamedType   `json:"queryType"`
	MutationType     *ResponseNamedType  `json:"mutationType,omitempty"`
	SubscriptionType *ResponseNamedType  `json:"subscriptionType,omitempty"`
	Types            ResponseSchemaTypes `json:"types"`
	// Interfaces    ResponseSchemaTypes `json:"interfaces"`
	// PossibleTypes ResponseSchemaTypes `json:"possibleTypes"`
	Directives []ResponseDirective `json:"directives"`
}

func (*ResponseSchema) Mutation

func (s *ResponseSchema) Mutation() *ResponseType

func (*ResponseSchema) Query

func (s *ResponseSchema) Query() *ResponseType

func (*ResponseSchema) Subscription

func (s *ResponseSchema) Subscription() *ResponseType

type ResponseSchemaTypes

type ResponseSchemaTypes []*ResponseType

func (ResponseSchemaTypes) Get

type ResponseType

type ResponseType struct {
	Kind          ResponseTypeKind     `json:"kind"`
	Name          string               `json:"name"`
	Description   string               `json:"description,omitempty"`
	Fields        []*ResponseField     `json:"fields,omitempty"`
	InputFields   []ResponseInputValue `json:"inputFields,omitempty"`
	EnumValues    []ResponseEnumValue  `json:"enumValues,omitempty"`
	Interfaces    ResponseSchemaTypes  `json:"interfaces,omitempty"`
	PossibleTypes ResponseSchemaTypes  `json:"possibleTypes,omitempty"`
}

type ResponseTypeKind

type ResponseTypeKind string

type ResponseTypeRef

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

func (ResponseTypeRef) IsList

func (r ResponseTypeRef) IsList() bool

func (ResponseTypeRef) IsObject

func (r ResponseTypeRef) IsObject() bool

func (ResponseTypeRef) IsOptional

func (r ResponseTypeRef) IsOptional() bool

func (ResponseTypeRef) IsScalar

func (r ResponseTypeRef) IsScalar() bool

type Scalar

type Scalar string

type Schema

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

func WrapSchema

func WrapSchema(schema *ast.Schema) *Schema

func (*Schema) Description

func (s *Schema) Description() string

func (*Schema) Directives

func (s *Schema) Directives() []*Directive

func (*Schema) MutationType

func (s *Schema) MutationType() *Type

func (*Schema) QueryType

func (s *Schema) QueryType() *Type

func (*Schema) SubscriptionType

func (s *Schema) SubscriptionType() *Type

func (*Schema) Type

func (s *Schema) Type() *ast.Type

func (*Schema) TypeDescription

func (s *Schema) TypeDescription() string

func (*Schema) Types

func (s *Schema) Types() []*Type

type Type

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

func WrapTypeFromDef

func WrapTypeFromDef(s *ast.Schema, def *ast.Definition) *Type

func WrapTypeFromType

func WrapTypeFromType(s *ast.Schema, typ *ast.Type) *Type

func (*Type) Description

func (t *Type) Description() string

func (*Type) EnumValues

func (t *Type) EnumValues(includeDeprecated bool) []*EnumValue

func (*Type) Fields

func (t *Type) Fields(includeDeprecated bool) []*Field

func (*Type) InputFields

func (t *Type) InputFields() []*InputValue

func (*Type) Interfaces

func (t *Type) Interfaces() []*Type

func (*Type) Kind

func (t *Type) Kind() string

func (*Type) Name

func (t *Type) Name() *string

func (*Type) OfType

func (t *Type) OfType() *Type

func (*Type) PossibleTypes

func (t *Type) PossibleTypes() []*Type

func (*Type) SpecifiedByURL

func (t *Type) SpecifiedByURL() *string

func (*Type) Type

func (t *Type) Type() *ast.Type

func (*Type) TypeDescription

func (t *Type) TypeDescription() string

type TypeKind

type TypeKind string

func (TypeKind) Decoder

func (k TypeKind) Decoder() dagql.InputDecoder

func (TypeKind) ToLiteral

func (k TypeKind) ToLiteral() call.Literal

func (TypeKind) Type

func (k TypeKind) Type() *ast.Type

func (TypeKind) TypeDescription

func (k TypeKind) TypeDescription() string

Jump to

Keyboard shortcuts

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