Documentation
¶
Index ¶
- Variables
- func AddRule(name string, ruleFunc RuleFunc)
- func IsValidFloatString(val reflect.Value, kind reflect.Kind) bool
- func IsValidIntString(val reflect.Value, kind reflect.Kind) bool
- func LoadSchema(inputs ...*Source) (*Schema, error)
- func RemoveRule(name string)
- func ReplaceRule(name string, ruleFunc RuleFunc)
- func Validate(schema *Schema, doc *QueryDocument, rules ...Rule) gqlerror.Listdeprecated
- func ValidateSchemaDocument(sd *SchemaDocument) (*Schema, error)
- func ValidateWithRules(schema *Schema, doc *QueryDocument, rules *validatorrules.Rules) gqlerror.List
- func VariableValues(schema *ast.Schema, op *ast.OperationDefinition, ...) (map[string]interface{}, error)
- func Walk(schema *Schema, document *QueryDocument, observers *Events)
- type AddErrFunc
- type ErrorOption
- type Events
- type Rule
- type RuleFunc
- type Walker
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Message = core.Message QuotedOrList = core.QuotedOrList OrList = core.OrList )
View Source
var ErrUnexpectedType = fmt.Errorf("Unexpected Type")
View Source
var Prelude = &ast.Source{ Name: "prelude.graphql", Input: preludeGraphql, BuiltIn: true, }
Functions ¶
func AddRule ¶
AddRule adds a rule to the rule set. ruleFunc is called once each time `Validate` is executed.
func IsValidFloatString ¶ added in v2.4.2
func IsValidIntString ¶ added in v2.4.2
func LoadSchema ¶
func LoadSchema(inputs ...*Source) (*Schema, error)
func RemoveRule ¶ added in v2.5.18
func RemoveRule(name string)
RemoveRule removes an existing rule from the rule set if one of the same name exists. The rule set is global, so it is not safe for concurrent changes
func ReplaceRule ¶ added in v2.5.21
ReplaceRule replaces an existing rule from the rule set if one of the same name exists. If no match is found, it will add a new rule to the rule set. The rule set is global, so it is not safe for concurrent changes
func ValidateSchemaDocument ¶
func ValidateSchemaDocument(sd *SchemaDocument) (*Schema, error)
func ValidateWithRules ¶ added in v2.5.29
func ValidateWithRules(schema *Schema, doc *QueryDocument, rules *validatorrules.Rules) gqlerror.List
func VariableValues ¶
func VariableValues(schema *ast.Schema, op *ast.OperationDefinition, variables map[string]interface{}) (map[string]interface{}, error)
VariableValues coerces and validates variable values
Types ¶
type AddErrFunc ¶
type AddErrFunc = core.AddErrFunc
type ErrorOption ¶
type ErrorOption = core.ErrorOption
Click to show internal directories.
Click to hide internal directories.