Documentation
¶
Index ¶
- type Argument
- type BlockValue
- type BooleanValue
- type Definition
- type DefinitionKind
- type Directive
- type DirectiveDefinition
- type DirectiveLocation
- type EnumValue
- type EnumValueDefinition
- type Field
- type FieldDefinition
- type FloatValue
- type FragmentDefinition
- type FragmentSpread
- type InlineFragment
- type IntValue
- type ListType
- type ListValue
- type NamedType
- type NonNullType
- type NullValue
- type ObjectField
- type ObjectValue
- type Operation
- type OperationDefinition
- type OperationTypeDefinition
- type QueryDocument
- type Schema
- type SchemaDefinition
- type SchemaDocument
- type Selection
- type SelectionSet
- type StringValue
- type Type
- type Value
- type Variable
- type VariableDefinition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockValue ¶
type BlockValue string
type BooleanValue ¶
type BooleanValue bool
type Definition ¶
type Definition struct { Kind DefinitionKind Description string Name string Directives []Directive Interfaces []NamedType // object and input object Fields []FieldDefinition // object and input object Types []NamedType // union Values []EnumValueDefinition // enum }
Definition is the core type definition object, it includes all of the definable types but does *not* cover schema or directives.
@vektah: Javascript implementation has different types for all of these, but they are more similar than different and don't define any behaviour. I think this style of "some hot" struct works better, at least for go.
Type extensions are also represented by this same struct.
func (*Definition) Field ¶
func (d *Definition) Field(name string) *FieldDefinition
func (*Definition) IsAbstractType ¶
func (d *Definition) IsAbstractType() bool
type DefinitionKind ¶
type DefinitionKind string
const ( Scalar DefinitionKind = "SCALAR" Object DefinitionKind = "OBJECT" Interface DefinitionKind = "INTERFACE" Union DefinitionKind = "UNION" Enum DefinitionKind = "ENUM" InputObject DefinitionKind = "INPUT_OBJECT" )
type DirectiveDefinition ¶
type DirectiveDefinition struct { Description string Name string Arguments []FieldDefinition Locations []DirectiveLocation }
type DirectiveLocation ¶
type DirectiveLocation string
const ( // Executable LocationQuery DirectiveLocation = `QUERY` LocationMutation DirectiveLocation = `MUTATION` LocationSubscription DirectiveLocation = `SUBSCRIPTION` LocationField DirectiveLocation = `FIELD` LocationFragmentDefinition DirectiveLocation = `FRAGMENT_DEFINITION` LocationFragmentSpread DirectiveLocation = `FRAGMENT_SPREAD` LocationInlineFragment DirectiveLocation = `INLINE_FRAGMENT` // Type System LocationSchema DirectiveLocation = `SCHEMA` LocationScalar DirectiveLocation = `SCALAR` LocationObject DirectiveLocation = `OBJECT` LocationFieldDefinition DirectiveLocation = `FIELD_DEFINITION` LocationArgumentDefinition DirectiveLocation = `ARGUMENT_DEFINITION` LocationIinterface DirectiveLocation = `INTERFACE` LocationUnion DirectiveLocation = `UNION` LocationEnum DirectiveLocation = `ENUM` LocationEnumValue DirectiveLocation = `ENUM_VALUE` LocationInputObject DirectiveLocation = `INPUT_OBJECT` LocationInputFieldDefinition DirectiveLocation = `INPUT_FIELD_DEFINITION` )
type EnumValueDefinition ¶
type Field ¶
type Field struct { Alias string Name string Arguments []Argument Directives []Directive SelectionSet SelectionSet }
type FieldDefinition ¶
type FloatValue ¶
type FloatValue string
type FragmentDefinition ¶
type FragmentDefinition struct { Name string // Note: fragment variable definitions are experimental and may be changed // or removed in the future. VariableDefinition []VariableDefinition TypeCondition NamedType Directives []Directive SelectionSet SelectionSet }
type FragmentSpread ¶
type InlineFragment ¶
type InlineFragment struct { TypeCondition NamedType Directives []Directive SelectionSet SelectionSet }
type NonNullType ¶
type NonNullType struct {
Type Type
}
type ObjectField ¶
type ObjectValue ¶
type ObjectValue []ObjectField
type OperationDefinition ¶
type OperationDefinition struct { Operation Operation Name string VariableDefinitions []VariableDefinition Directives []Directive SelectionSet SelectionSet }
type OperationTypeDefinition ¶
type QueryDocument ¶
type QueryDocument struct { Operations []OperationDefinition Fragments []FragmentDefinition }
func ParseQuery ¶
func ParseQuery(source string) (QueryDocument, *errors.Syntax)
func (QueryDocument) GetFragment ¶
func (d QueryDocument) GetFragment(name string) *FragmentDefinition
func (QueryDocument) GetOperation ¶
func (d QueryDocument) GetOperation(name string) *OperationDefinition
type Schema ¶
type Schema struct { Query *Definition Mutation *Definition Subscription *Definition Types map[string]*Definition Directives map[string]*DirectiveDefinition // contains filtered or unexported fields }
func LoadSchema ¶
func (*Schema) GetPossibleTypes ¶
func (s *Schema) GetPossibleTypes(def *Definition) []*Definition
GetPossibleTypes will enumerate all the definitions for a given interface or union
type SchemaDefinition ¶
type SchemaDefinition struct { Description string Directives []Directive OperationTypes []OperationTypeDefinition }
type SchemaDocument ¶
type SchemaDocument struct { Schema []SchemaDefinition SchemaExtension []SchemaDefinition Directives []DirectiveDefinition Definitions []Definition Extensions []Definition }
func ParseSchema ¶
func ParseSchema(source string) (SchemaDocument, *errors.Syntax)
type SelectionSet ¶
type SelectionSet []Selection
type StringValue ¶
type StringValue string
type VariableDefinition ¶
Click to show internal directories.
Click to hide internal directories.