Documentation ¶
Index ¶
- func AsNodes(raw interface{}) ([]ast.Node, error)
- type Bagger
- func (b *Bagger) AddFieldMutation(field *ast.FieldDefinition) error
- func (b *Bagger) AddFieldQuery(field *ast.FieldDefinition) error
- func (b *Bagger) AddFieldSubscription(field *ast.FieldDefinition) error
- func (b *Bagger) AddNode(node ast.Node) error
- func (b *Bagger) Export(queryObject, mutationObject, subscriptionObject *ast.ObjectDefinition) *ast.Document
- func (b *Bagger) GetDirectives() map[string]*ast.DirectiveDefinition
- func (b *Bagger) GetEnums() map[string]*ast.EnumDefinition
- func (b *Bagger) GetExtensions() map[string]*ast.TypeExtensionDefinition
- func (b *Bagger) GetFieldsMutation() map[string]*ast.FieldDefinition
- func (b *Bagger) GetFieldsQuery() map[string]*ast.FieldDefinition
- func (b *Bagger) GetFieldsSubscription() map[string]*ast.FieldDefinition
- func (b *Bagger) GetInputObjects() map[string]*ast.InputObjectDefinition
- func (b *Bagger) GetInterfaces() map[string]*ast.InterfaceDefinition
- func (b *Bagger) GetObjects() map[string]*ast.ObjectDefinition
- func (b *Bagger) GetScalars() map[string]*ast.ScalarDefinition
- func (b *Bagger) GetUnions() map[string]*ast.UnionDefinition
- func (b *Bagger) IngestBags(bags ...*Bagger) error
- func (b *Bagger) IngestDocument(doc *ast.Document) error
- func (b *Bagger) ValidateName(node ast.Node) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Bagger ¶
type Bagger struct {
// contains filtered or unexported fields
}
Bagger helpers accumulate a unique (and therefore schema-valid) set of each kind of graphql type keyed by node name, handily providing helpers to add fields directly to top-level query/mutation/subscription types
func NewBagger ¶
func NewBagger() *Bagger
NewBagger constructs the bagger and allocates the necessary internal maps
func (*Bagger) AddFieldMutation ¶
func (b *Bagger) AddFieldMutation(field *ast.FieldDefinition) error
AddFieldMutation adds a single mutation field definition
func (*Bagger) AddFieldQuery ¶
func (b *Bagger) AddFieldQuery(field *ast.FieldDefinition) error
AddFieldQuery adds a single query field definition
func (*Bagger) AddFieldSubscription ¶
func (b *Bagger) AddFieldSubscription(field *ast.FieldDefinition) error
AddFieldSubscription adds a single subscription field definition
func (*Bagger) AddNode ¶
AddNode adds a single node of any kind, don't add fields directly here, see one of the following:
AddFieldQuery, AddFieldMutation, AddFieldSubscription
func (*Bagger) Export ¶
func (b *Bagger) Export( queryObject, mutationObject, subscriptionObject *ast.ObjectDefinition, ) *ast.Document
Export writes the contents of the Bager to a document, sorting everything along the way
func (*Bagger) GetDirectives ¶
func (b *Bagger) GetDirectives() map[string]*ast.DirectiveDefinition
GetDirectives returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetEnums ¶
func (b *Bagger) GetEnums() map[string]*ast.EnumDefinition
GetEnums returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetExtensions ¶
func (b *Bagger) GetExtensions() map[string]*ast.TypeExtensionDefinition
GetExtensions returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetFieldsMutation ¶
func (b *Bagger) GetFieldsMutation() map[string]*ast.FieldDefinition
GetFieldsMutation returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetFieldsQuery ¶
func (b *Bagger) GetFieldsQuery() map[string]*ast.FieldDefinition
GetFieldsQuery returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetFieldsSubscription ¶
func (b *Bagger) GetFieldsSubscription() map[string]*ast.FieldDefinition
GetFieldsSubscription returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetInputObjects ¶
func (b *Bagger) GetInputObjects() map[string]*ast.InputObjectDefinition
GetInputObjects returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetInterfaces ¶
func (b *Bagger) GetInterfaces() map[string]*ast.InterfaceDefinition
GetInterfaces returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetObjects ¶
func (b *Bagger) GetObjects() map[string]*ast.ObjectDefinition
GetObjects returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetScalars ¶
func (b *Bagger) GetScalars() map[string]*ast.ScalarDefinition
GetScalars returns the underlying map, which can be directly edited (carefully)
func (*Bagger) GetUnions ¶
func (b *Bagger) GetUnions() map[string]*ast.UnionDefinition
GetUnions returns the underlying map, which can be directly edited (carefully)
func (*Bagger) IngestBags ¶
IngestBags merges all types across 1+ bags into the current bag
func (*Bagger) IngestDocument ¶
IngestDocument ingests the contents of a document