File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ require (
22
22
github.com/dgraph-io/badger/v3 v3.0.0-20210825061050-c2b23c471f5e
23
23
github.com/dgraph-io/dgo/v210 v210.0.0-20210825123656-d3f867fe9cc3
24
24
github.com/dgraph-io/gqlgen v0.13.2
25
- github.com/dgraph-io/gqlparser/v2 v2.2.0
25
+ github.com/dgraph-io/gqlparser/v2 v2.2.1
26
26
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15
27
27
github.com/dgraph-io/ristretto v0.1.1-0.20210824115121-89e99415887a
28
28
github.com/dgraph-io/simdjson-go v0.3.0
Original file line number Diff line number Diff line change @@ -173,8 +173,8 @@ github.com/dgraph-io/dgo/v210 v210.0.0-20210825123656-d3f867fe9cc3/go.mod h1:dCz
173
173
github.com/dgraph-io/gqlgen v0.13.2 h1:TNhndk+eHKj5qE7BenKKSYdSIdOGhLqxR1rCiMso9KM =
174
174
github.com/dgraph-io/gqlgen v0.13.2 /go.mod h1:iCOrOv9lngN7KAo+jMgvUPVDlYHdf7qDwsTkQby2Sis =
175
175
github.com/dgraph-io/gqlparser/v2 v2.1.1 /go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU =
176
- github.com/dgraph-io/gqlparser/v2 v2.2.0 h1:fKSCW8OxoMogjDwUhO9OrFvrgIA0UZspTDbcm0QGk9M =
177
- github.com/dgraph-io/gqlparser/v2 v2.2.0 /go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU =
176
+ github.com/dgraph-io/gqlparser/v2 v2.2.1 h1:15msK9XEHOSrRqQO48UU+2ZTf1R1U8+tfL9H5D5/eQQ =
177
+ github.com/dgraph-io/gqlparser/v2 v2.2.1 /go.mod h1:MYS4jppjyx8b9tuUtjV7jU1UFZK6P9fvO8TsIsQtRKU =
178
178
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15 h1:X2NRsgAtVUAp2nmTPCq+x+wTcRRrj74CEpy7E0Unsl4 =
179
179
github.com/dgraph-io/graphql-transport-ws v0.0.0-20210511143556-2cef522f1f15 /go.mod h1:7z3c/5w0sMYYZF5bHsrh8IH4fKwG5O5Y70cPH1ZLLRQ =
180
180
github.com/dgraph-io/ristretto v0.1.0 /go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug =
Original file line number Diff line number Diff line change @@ -47,7 +47,11 @@ func init() {
47
47
validator .AddRule ("Check variable type is correct" , variableTypeCheck )
48
48
validator .AddRule ("Check arguments of cascade directive" , directiveArgumentsCheck )
49
49
validator .AddRule ("Check range for Int type" , intRangeCheck )
50
- validator .AddRule ("Input Coercion to List" , listInputCoercion )
50
+ // Graphql accept both single object and array of objects as value when the schema is defined
51
+ // as an array. listInputCoercion changes the value to array if the single object is provided.
52
+ // Changing the value can mess up with the other data validation rules hence we are setting
53
+ // up the order to a high value so that it will be executed last.
54
+ validator .AddRuleWithOrder ("Input Coercion to List" , 100 , listInputCoercion )
51
55
validator .AddRule ("Check filter functions" , filterCheck )
52
56
53
57
}
You can’t perform that action at this time.
0 commit comments