Documentation ¶
Overview ¶
Package introspection takes a GraphQL Schema and provides the introspection JSON to fulfill introspection queries.
Index ¶
Constants ¶
View Source
const ( DeprecatedDirectiveName = "deprecated" DeprecationReasonArgName = "reason" )
View Source
const ( // SCALAR is a __TypeKind of type SCALAR. SCALAR __TypeKind = iota // LIST is a __TypeKind of type LIST. LIST // NONNULL is a __TypeKind of type NON_NULL. NONNULL // OBJECT is a __TypeKind of type OBJECT. OBJECT // ENUM is a __TypeKind of type ENUM. ENUM // INTERFACE is a __TypeKind of type INTERFACE. INTERFACE // UNION is a __TypeKind of type UNION. UNION // INPUTOBJECT is a __TypeKind of type INPUT_OBJECT. INPUTOBJECT )
Variables ¶
View Source
var ErrInvalid__TypeKind = errors.New("not a valid __TypeKind")
Functions ¶
func Parse__TypeKind ¶
Parse__TypeKind attempts to convert a string to a __TypeKind.
Types ¶
type Directive ¶
type Directive struct { Name string `json:"name"` Description string `json:"description"` Locations []string `json:"locations"` Args []InputValue `json:"args"` IsRepeatable bool `json:"isRepeatable"` TypeName string `json:"__typename"` }
func NewDirective ¶
func NewDirective() Directive
type Field ¶
type FullType ¶
type FullType struct { Kind __TypeKind `json:"kind"` Name string `json:"name"` Description string `json:"description"` // not empty for __TypeKind OBJECT and INTERFACE only Fields []Field `json:"fields,omitempty"` // not empty for __TypeKind INPUT_OBJECT only InputFields []InputValue `json:"inputFields"` // not empty for __TypeKind OBJECT only Interfaces []TypeRef `json:"interfaces"` // not empty for __TypeKind ENUM only EnumValues []EnumValue `json:"enumValues,omitempty"` // not empty for __TypeKind INTERFACE and UNION only PossibleTypes []TypeRef `json:"possibleTypes"` TypeName string `json:"__typename"` }
func NewFullType ¶
func NewFullType() *FullType
type Generator ¶
type Generator struct { Data *Data // contains filtered or unexported fields }
func NewGenerator ¶
func NewGenerator() *Generator
type InputValue ¶
type JsonConverter ¶
type JsonConverter struct {
// contains filtered or unexported fields
}
func (*JsonConverter) GraphQLDocument ¶
type Schema ¶
type Schema struct { QueryType FullType `json:"queryType"` MutationType *FullType `json:"mutationType"` SubscriptionType *FullType `json:"subscriptionType"` Types []*FullType `json:"types"` Directives []Directive `json:"directives"` TypeName string `json:"__typename"` // contains filtered or unexported fields }
func (*Schema) TypeByName ¶
Click to show internal directories.
Click to hide internal directories.