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 @@ -157,12 +157,17 @@ type Response struct {
157
157
158
158
// Validate validates the given query with the schema.
159
159
func (s * Schema ) Validate (queryString string ) []* errors.QueryError {
160
+ return s .ValidateWithVariables (queryString , nil )
161
+ }
162
+
163
+ // ValidateWithVariables validates the given query with the schema and the input variables.
164
+ func (s * Schema ) ValidateWithVariables (queryString string , variables map [string ]interface {}) []* errors.QueryError {
160
165
doc , qErr := query .Parse (queryString )
161
166
if qErr != nil {
162
167
return []* errors.QueryError {qErr }
163
168
}
164
169
165
- return validation .Validate (s .schema , doc , nil , s .maxDepth )
170
+ return validation .Validate (s .schema , doc , variables , s .maxDepth )
166
171
}
167
172
168
173
// 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