aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go')
-rw-r--r--vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go b/vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go
deleted file mode 100644
index e6d97c9f..00000000
--- a/vendor/github.com/vektah/gqlparser/validator/rules/variables_in_allowed_position.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package validator
-
-import (
- "github.com/vektah/gqlparser/ast"
- . "github.com/vektah/gqlparser/validator"
-)
-
-func init() {
- AddRule("VariablesInAllowedPosition", func(observers *Events, addError AddErrFunc) {
- observers.OnValue(func(walker *Walker, value *ast.Value) {
- if value.Kind != ast.Variable || value.ExpectedType == nil || value.VariableDefinition == nil || walker.CurrentOperation == nil {
- return
- }
-
- // todo: move me into walk
- // If there is a default non nullable types can be null
- if value.VariableDefinition.DefaultValue != nil && value.VariableDefinition.DefaultValue.Kind != ast.NullValue {
- if value.ExpectedType.NonNull {
- value.ExpectedType.NonNull = false
- }
- }
-
- if !value.VariableDefinition.Type.IsCompatible(value.ExpectedType) {
- addError(
- Message(
- `Variable "%s" of type "%s" used in position expecting type "%s".`,
- value,
- value.VariableDefinition.Type.String(),
- value.ExpectedType.String(),
- ),
- At(value.Position),
- )
- }
- })
- })
-}