Documentation ¶
Overview ¶
Package introspection adds very basic remote GraphQL introspection funcionality
Index ¶
- type Arg
- type Field
- type Schema
- type Type
- func (t Type) Deref(types []Type) Type
- func (t Type) Enum() bool
- func (t Type) GetOfTypeLeaf() Type
- func (t Type) GoString() string
- func (t Type) Input() bool
- func (t Type) Interface() bool
- func (t Type) List() bool
- func (t Type) Named() bool
- func (t Type) NonNull() bool
- func (t Type) Object() bool
- func (t Type) Scalar() bool
- func (t Type) TypeForPath(schema Schema, path []string) (tt Type, ok bool)
- func (t Type) TypeRef() bool
- func (t Type) Union() bool
- func (t Type) Valid() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Arg ¶
type Arg struct { // Name is a schema defined argument name Name string `json:"name,omitempty"` // Description is a schema defined argument description Description string `json:"description,omitempty"` // Type is a type or type reference defined by schema Type Type `json:"type,omitempty"` DefaultValue string `json:"defaultValue,omitempty"` }
Arg is graphql field argument
type Field ¶
type Field struct { // Args is a list of arguments for a field defined by schema Args []Arg `json:"args,omitempty"` // Name is a field name defined by schema Name string `json:"name,omitempty"` // Type is a type or type reference defined by schema Type Type `json:"type,omitempty"` // Description is a schema defined argument description Description string `json:"description,omitempty"` }
Field is graphql field
func (Field) ArgsString ¶
ArgsString formats field arguments as they would apear in schema
type Schema ¶
type Schema struct { // Types defined in schema Types []Type `json:"types,omitempty"` // QueryType is a reference to a type of query root operation QueryType Type `json:"queryType"` // MutationType is a reference to a type of mutation root operation MutationType Type `json:"mutationType,omitempty"` // SubscriptionType is a reference to a type of subscription root operation SubscriptionType Type `json:"subscriptionType,omitempty"` }
Schema is a representation of remote schema returned by schema introspection
func GetSchemaTypes ¶
GetSchemaTypes runs introspection query on remote endpoint returning schema
func (Schema) FieldForPath ¶
FieldForPath finds a field to which path would resolve to
type Type ¶
type Type struct { // Name is a type or type reference name Name string `json:"name,omitempty"` // Fields is a list of fields for this type, defined by schema // Object and Interface only Fields []Field `json:"fields,omitempty"` // Kind is a type kind, refer to https://godoc.org/github.com/graphql-go/graphql#pkg-constants // for valid list of type kinds Kind string `json:"kind,omitempty"` // Description is a schema defined argument description Description string `json:"description,omitempty"` // PossibleTypes is a list of possible types defined by schema // only valid for Union and Interface kidns PossibleTypes []Type `json:"possibleTypes,omitempty"` // OfType is a type reference which this type wraps // only valid for NonNull and List type kinds OfType *Type `json:"ofType,omitempty"` }
Type is graphql type definition
func GetTypeInfo ¶
GetTypeInfo fetches type information from remote endpoint
func (Type) GetOfTypeLeaf ¶
GetOfTypeLeaf follows solves all NonNull/List types until it reaches named type
func (Type) TypeForPath ¶
TypeForPath seeks a type in schema matching resolve path. First element of path must match one of type fields