File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,17 @@ type Response struct {
146
146
147
147
// Validate validates the given query with the schema.
148
148
func (s * Schema ) Validate (queryString string ) []* errors.QueryError {
149
+ return s .ValidateWithVariables (queryString , nil )
150
+ }
151
+
152
+ // ValidateWithVariables validates the given query with the schema and the input variables.
153
+ func (s * Schema ) ValidateWithVariables (queryString string , variables map [string ]interface {}) []* errors.QueryError {
149
154
doc , qErr := query .Parse (queryString )
150
155
if qErr != nil {
151
156
return []* errors.QueryError {qErr }
152
157
}
153
158
154
- return validation .Validate (s .schema , doc , nil , s .maxDepth )
159
+ return validation .Validate (s .schema , doc , variables , s .maxDepth )
155
160
}
156
161
157
162
// Exec executes the given query with the schema's resolver. It panics if the schema was created
You can’t perform that action at this time.
0 commit comments