introspection

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

View Source
const (
	QUERY               DirectiveLocation = "QUERY"
	MUTATION                              = "MUTATION"
	FIELD                                 = "FIELD"
	FRAGMENT_DEFINITION                   = "FRAGMENT_DEFINITION"
	FRAGMENT_SPREAD                       = "FRAGMENT_SPREAD"
	INLINE_FRAGMENT                       = "INLINE_FRAGMENT"
)
View Source
const (
	SCALAR       TypeKind = "SCALAR"
	OBJECT                = "OBJECT"
	INTERFACE             = "INTERFACE"
	UNION                 = "UNION"
	ENUM                  = "ENUM"
	INPUT_OBJECT          = "INPUT_OBJECT"
	LIST                  = "LIST"
	NON_NULL              = "NON_NULL"
)
View Source
const IntrospectionQuery = `` /* 1019-byte string literal not displayed */

Copied from https://github.com/graphql/graphiql/blob/master/src/utility/introspectionQueries.js

Variables

View Source
var IncludeDirective = Directive{
	Description: "Directs the executor to include this field or fragment only when the `if` argument is true.",
	Locations: []DirectiveLocation{
		FIELD,
		FRAGMENT_SPREAD,
		INLINE_FRAGMENT,
	},
	Name: "include",
	Args: []InputValue{
		InputValue{
			Name:        "if",
			Type:        Type{Inner: &graphql.NonNull{Type: &graphql.Scalar{Type: "bool"}}},
			Description: "Included when true.",
		},
	},
}
View Source
var SkipDirective = Directive{
	Description: "Directs the executor to skip this field or fragment only when the `if` argument is true.",
	Locations: []DirectiveLocation{
		FIELD,
		FRAGMENT_SPREAD,
		INLINE_FRAGMENT,
	},
	Name: "skip",
	Args: []InputValue{
		InputValue{
			Name:        "if",
			Type:        Type{Inner: &graphql.NonNull{Type: &graphql.Scalar{Type: "bool"}}},
			Description: "Skipped when true.",
		},
	},
}
View Source
var TypeAsOptionalDirective = Directive{
	Description: "Client-side-only directive that instructs the type generator to mark this field as optional. This is useful for making the generated types compliant with Troy persistence schema.",
	Locations: []DirectiveLocation{
		FIELD,
	},
	Name: "type_as_optional",
	Args: []InputValue{},
}

Functions

func AddIntrospectionToSchema

func AddIntrospectionToSchema(schema *graphql.Schema)

func BareIntrospectionSchema

func BareIntrospectionSchema(schema *graphql.Schema) *graphql.Schema

func ComputeSchemaJSON

func ComputeSchemaJSON(schemaBuilderSchema schemabuilder.Schema) ([]byte, error)

ComputeSchemaJSON returns the result of executing a GraphQL introspection query.

func IntrospectionQueryTypeOrSelection

func IntrospectionQueryTypeOrSelection(typeName, selectionName string) bool

func RunIntrospectionQuery

func RunIntrospectionQuery(schema *graphql.Schema) ([]byte, error)

RunIntrospectionQuery returns the result of executing a GraphQL introspection query.

Types

type Directive

type Directive struct {
	Name        string
	Description string
	Locations   []DirectiveLocation
	Args        []InputValue
}

type DirectiveLocation

type DirectiveLocation string

type EnumValue

type EnumValue struct {
	Name              string
	Description       string
	IsDeprecated      bool
	DeprecationReason string
}

type InputValue

type InputValue struct {
	Name         string
	Description  string
	Type         Type
	DefaultValue *string
}

type Schema

type Schema struct {
	Types            []Type
	QueryType        *Type
	MutationType     *Type
	SubscriptionType *Type
	Directives       []Directive
}

type Type

type Type struct {
	Inner graphql.Type `graphql:"-"`
}

type TypeKind

type TypeKind string

Jump to

Keyboard shortcuts

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