Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DirectiveDecl ¶
type DirectiveDecl struct { Name string Desc string Locs []string Args common.InputValueList }
http://facebook.github.io/graphql/draft/#sec-Type-System.Directives
type Enum ¶
type Enum struct { Name string Values []*EnumValue // NOTE: the spec refers to this as `EnumValuesDefinition`. Desc string }
Enum types describe a set of possible values.
Like scalar types, Enum types also represent leaf values in a GraphQL type system.
http://facebook.github.io/graphql/draft/#sec-Enums
func (*Enum) Description ¶
type EnumValue ¶
type EnumValue struct { Name string Directives common.DirectiveList Desc string }
EnumValue types are unique values that may be serialized as a string: the name of the represented value.
http://facebook.github.io/graphql/draft/#EnumValueDefinition
type Extension ¶
type Extension struct {
Type NamedType
}
Extension type defines a GraphQL type extension. Schemas, Objects, Inputs and Scalars can be extended.
https://facebook.github.io/graphql/draft/#sec-Type-System-Extensions
type Field ¶
type Field struct { Name string Args common.InputValueList // NOTE: the spec refers to this as `ArgumentsDefinition`. Type common.Type Directives common.DirectiveList Desc string }
Field is a conceptual function which yields values. http://facebook.github.io/graphql/draft/#FieldDefinition
type FieldList ¶
type FieldList []*Field
FieldsList is a list of an Object's Fields.
type InputObject ¶
type InputObject struct { Name string Desc string Values common.InputValueList }
InputObject types define a set of input fields; the input fields are either scalars, enums, or other input objects.
This allows arguments to accept arbitrarily complex structs.
http://facebook.github.io/graphql/draft/#sec-Input-Objects
func (*InputObject) Description ¶
func (t *InputObject) Description() string
func (*InputObject) Kind ¶
func (*InputObject) Kind() string
func (*InputObject) String ¶
func (t *InputObject) String() string
func (*InputObject) TypeName ¶
func (t *InputObject) TypeName() string
type Interface ¶
type Interface struct { Name string PossibleTypes []*Object Fields FieldList // NOTE: the spec refers to this as `FieldsDefinition`. Desc string }
Interface types represent a list of named fields and their arguments.
GraphQL objects can then implement these interfaces which requires that the object type will define all fields defined by those interfaces.
http://facebook.github.io/graphql/draft/#sec-Interfaces
func (*Interface) Description ¶
type Object ¶
type Object struct { Name string Interfaces []*Interface Fields FieldList Desc string // contains filtered or unexported fields }
Object types represent a list of named fields, each of which yield a value of a specific type.
GraphQL queries are hierarchical and composed, describing a tree of information. While Scalar types describe the leaf values of these hierarchical types, Objects describe the intermediate levels.
http://facebook.github.io/graphql/draft/#sec-Objects
func (*Object) Description ¶
type Scalar ¶
Scalar types represent primitive leaf values (e.g. a string or an integer) in a GraphQL type system.
GraphQL responses take the form of a hierarchical tree; the leaves on these trees are GraphQL scalars.
http://facebook.github.io/graphql/draft/#sec-Scalars
func (*Scalar) Description ¶
type Schema ¶
type Schema struct { // EntryPoints determines the place in the type system where `query`, `mutation`, and // `subscription` operations begin. // // http://facebook.github.io/graphql/draft/#sec-Root-Operation-Types // // NOTE: The specification refers to this concept as "Root Operation Types". // TODO: Rename the `EntryPoints` field to `RootOperationTypes` to align with spec terminology. EntryPoints map[string]NamedType // Types are the fundamental unit of any GraphQL schema. // There are six kinds of named types, and two wrapping types. // // http://facebook.github.io/graphql/draft/#sec-Types Types map[string]NamedType // Directives are used to annotate various parts of a GraphQL document as an indicator that they // should be evaluated differently by a validator, executor, or client tool such as a code // generator. // // http://facebook.github.io/graphql/draft/#sec-Type-System.Directives Directives map[string]*DirectiveDecl UseFieldResolvers bool // contains filtered or unexported fields }
Schema represents a GraphQL service's collective type system capabilities. A schema is defined in terms of the types and directives it supports as well as the root operation types for each kind of operation: `query`, `mutation`, and `subscription`.
For a more formal definition, read the relevant section in the specification:
type Union ¶
type Union struct { Name string PossibleTypes []*Object // NOTE: the spec refers to this as `UnionMemberTypes`. Desc string // contains filtered or unexported fields }
Union types represent objects that could be one of a list of GraphQL object types, but provides no guaranteed fields between those types.
They also differ from interfaces in that object types declare what interfaces they implement, but are not aware of what unions contain them.
http://facebook.github.io/graphql/draft/#sec-Unions