@@ -4,6 +4,10 @@ local util = require(path .. '.util')
4
4
local introspection = require (path .. ' .introspection' )
5
5
local query_util = require (path .. ' .query_util' )
6
6
7
+ local function error (...)
8
+ return _G .error (... , 0 )
9
+ end
10
+
7
11
local function getParentField (context , name , count )
8
12
if introspection .fieldMap [name ] then return introspection .fieldMap [name ] end
9
13
@@ -517,6 +521,19 @@ local function isVariableTypesValid(argument, argumentType, context,
517
521
' is not compatible with the argument type "%s"' ):format (variableName ,
518
522
util .getTypeName (variableType ), util .getTypeName (argumentType ))
519
523
end
524
+ elseif argument .value .kind == ' list' then
525
+ -- find variables deeper
526
+ local parentType = argumentType
527
+ if parentType .__type == ' NonNull' then
528
+ parentType = parentType .ofType
529
+ end
530
+ local childType = parentType .ofType
531
+
532
+ for _ , child in ipairs (argument .value .values ) do
533
+ local ok , err = isVariableTypesValid ({value = child }, childType , context ,
534
+ variableMap )
535
+ if not ok then return false , err end
536
+ end
520
537
elseif argument .value .kind == ' inputObject' then
521
538
-- find variables deeper
522
539
for _ , child in ipairs (argument .value .values ) do
0 commit comments