stash/vendor/github.com/vektah/gqlparser/v2/ast/directive.go
WithoutPants 7a45943e8e
Stash box client interface (#751)
* Add gql client generation files
* Update dependencies
* Add stash-box client generation to the makefile
* Move scraped scene object matchers to models
* Add stash-box to scrape with dropdown
* Add scrape scene from fingerprint in UI
2020-09-17 19:57:18 +10:00

42 lines
1.6 KiB
Go

package ast
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`
LocationInterface DirectiveLocation = `INTERFACE`
LocationUnion DirectiveLocation = `UNION`
LocationEnum DirectiveLocation = `ENUM`
LocationEnumValue DirectiveLocation = `ENUM_VALUE`
LocationInputObject DirectiveLocation = `INPUT_OBJECT`
LocationInputFieldDefinition DirectiveLocation = `INPUT_FIELD_DEFINITION`
)
type Directive struct {
Name string
Arguments ArgumentList
Position *Position `dump:"-"`
// Requires validation
ParentDefinition *Definition
Definition *DirectiveDefinition
Location DirectiveLocation
}
func (d *Directive) ArgumentMap(vars map[string]interface{}) map[string]interface{} {
return arg2map(d.Definition.Arguments, d.Arguments, vars)
}