From e3daad8fcb603b3d5a15b08d5c52654d72d5042a Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 12:41:29 +0300 Subject: [PATCH 1/7] Propagate box.NULL result Based on @no1seman PR [1]. 1. https://github.com/tarantool/graphql/pull/59 --- graphql/execute.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/execute.lua b/graphql/execute.lua index fe1d1bd..aeae146 100644 --- a/graphql/execute.lua +++ b/graphql/execute.lua @@ -193,7 +193,7 @@ local function completeValue(fieldType, result, subSelections, context, opts) end if result == nil then - return nil + return result end if fieldTypeName == 'List' then From eaa9c3ccf78aff4ac791fe3c10ca446108442b2f Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 12:43:47 +0300 Subject: [PATCH 2/7] Do not throw "no value provided" for box.NULL result Based on @no1seman PR [1]. 1. https://github.com/tarantool/graphql/pull/59 --- graphql/execute.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphql/execute.lua b/graphql/execute.lua index aeae146..b9fda32 100644 --- a/graphql/execute.lua +++ b/graphql/execute.lua @@ -176,7 +176,7 @@ local function completeValue(fieldType, result, subSelections, context, opts) local innerType = fieldType.ofType local completedResult = completeValue(innerType, result, subSelections, context, opts) - if completedResult == nil then + if type(completedResult) == 'nil' then local err = string.format( 'No value provided for non-null %s %q', (innerType.name or innerType.__type), From b552e26749c7b50096e1111841e1d020d78d2048 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 12:45:21 +0300 Subject: [PATCH 3/7] Fix variables coerce Based on @no1seman PR [1]. 1. https://github.com/tarantool/graphql/pull/59 --- graphql/rules.lua | 4 +++- graphql/util.lua | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/graphql/rules.lua b/graphql/rules.lua index c902aca..6b63f2e 100644 --- a/graphql/rules.lua +++ b/graphql/rules.lua @@ -198,13 +198,15 @@ function rules.uniqueArgumentNames(node, _) end end +local coerce_opts = { strict_non_null = true, skip_variables = true } + function rules.argumentsOfCorrectType(node, context) if node.arguments then local parentField = getParentField(context, node.name.value) for _, argument in pairs(node.arguments) do local name = argument.name.value local argumentType = parentField.arguments[name] - util.coerceValue(argument.value, argumentType.kind or argumentType) + util.coerceValue(argument.value, argumentType.kind or argumentType, nil, coerce_opts) end end end diff --git a/graphql/util.lua b/graphql/util.lua index 852e26c..5ef1d42 100644 --- a/graphql/util.lua +++ b/graphql/util.lua @@ -83,8 +83,13 @@ local function coerceValue(node, schemaType, variables, opts) variables = variables or {} opts = opts or {} local strict_non_null = opts.strict_non_null or false + local skip_variables = opts.skip_variables or false local defaultValues = opts.defaultValues or {} + if node and node.kind == 'variable' and skip_variables then + return nil + end + if schemaType.__type == 'NonNull' then local res = coerceValue(node, schemaType.ofType, variables, opts) if strict_non_null and res == nil then From 5a31f850b9f32d2059dd793fa86837b5e528e1d4 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 12:55:55 +0300 Subject: [PATCH 4/7] Allow using defaults for Non-null variables Specification does not explicitly forbid using defaults with Non-null variables. The discussion [1] states that it is legal. Reference JS implementation supports defaults for Non-null variables. 1. https://github.com/graphql/graphql-spec/issues/570 --- graphql/rules.lua | 6 ++---- graphql/validate_variables.lua | 19 ++++++++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/graphql/rules.lua b/graphql/rules.lua index 6b63f2e..93d4379 100644 --- a/graphql/rules.lua +++ b/graphql/rules.lua @@ -408,11 +408,9 @@ end function rules.variableDefaultValuesHaveCorrectType(node, context) if node.variableDefinitions then for _, definition in ipairs(node.variableDefinitions) do - if definition.type.kind == 'nonNullType' and definition.defaultValue then - error('Non-null variables can not have default values') - elseif definition.defaultValue then + if definition.defaultValue then local variableType = query_util.typeFromAST(definition.type, context.schema) - util.coerceValue(definition.defaultValue, variableType) + util.coerceValue(definition.defaultValue, variableType, nil, coerce_opts) end end end diff --git a/graphql/validate_variables.lua b/graphql/validate_variables.lua index 1f67f06..a94fa3b 100644 --- a/graphql/validate_variables.lua +++ b/graphql/validate_variables.lua @@ -7,15 +7,17 @@ local function error(...) end -- Traverse type more or less likewise util.coerceValue do. -local function checkVariableValue(variableName, value, variableType) +local function checkVariableValue(variableName, value, variableType, isNonNullDefaultDefined) check(variableName, 'variableName', 'string') check(variableType, 'variableType', 'table') local isNonNull = variableType.__type == 'NonNull' + isNonNullDefaultDefined = isNonNullDefaultDefined or false if isNonNull then variableType = types.nullable(variableType) - if value == nil then + if (type(value) == 'cdata' and value == nil) or + (type(value) == 'nil' and not isNonNullDefaultDefined) then error(('Variable %q expected to be non-null'):format(variableName)) end end @@ -116,8 +118,19 @@ local function validate_variables(context) -- check that variable values have correct type for variableName, variableType in pairs(context.variableTypes) do + -- Check if default value presents. + local isNonNullDefaultDefined = false + for _, variableDefinition in ipairs(context.operation.variableDefinitions) do + if variableDefinition.variable.name.value == variableName and + variableDefinition.defaultValue ~= nil then + if (variableDefinition.defaultValue.value ~= nil) or (variableDefinition.defaultValue.values ~= nil) then + isNonNullDefaultDefined = true + end + end + end + local value = (context.variables or {})[variableName] - checkVariableValue(variableName, value, variableType) + checkVariableValue(variableName, value, variableType, isNonNullDefaultDefined) end end From 033c1c9a31ce42ab29e1553541fb2ba2a095897b Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 12:55:56 +0300 Subject: [PATCH 5/7] Forbid using null default for Non-nullable args Specification [1] states that Nullable variable can be used for NonNullable argument if it has Non-null default. See more in [2] issue. 1. http://spec.graphql.org/October2021/#sec-All-Variable-Usages-are-Allowed 2. https://github.com/graphql/graphql-js/issues/3715 --- graphql/rules.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/graphql/rules.lua b/graphql/rules.lua index 93d4379..b0ff34b 100644 --- a/graphql/rules.lua +++ b/graphql/rules.lua @@ -507,12 +507,13 @@ local function isVariableTypesValid(argument, argumentType, context, error('Unknown variable "' .. variableName .. '"') end - local hasDefault = variableDefinition.defaultValue ~= nil + local hasNonNullDefault = (variableDefinition.defaultValue ~= nil) and + (variableDefinition.defaultValue.kind ~= 'null') local variableType = query_util.typeFromAST(variableDefinition.type, context.schema) - if hasDefault and variableType.__type ~= 'NonNull' then + if hasNonNullDefault and variableType.__type ~= 'NonNull' then variableType = types.nonNull(variableType) end From 07b0d20ae0e1e99d07ff871cb13241974ccdcd15 Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 13:25:55 +0300 Subject: [PATCH 6/7] Fix error message Code uses NonNull wrapper to support case when Nullable variable has a Non-null default value and is compatible with NonNullable argument. But if it really incompatible, the user should receive an error with original type in message. --- graphql/rules.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/graphql/rules.lua b/graphql/rules.lua index b0ff34b..49db35d 100644 --- a/graphql/rules.lua +++ b/graphql/rules.lua @@ -513,6 +513,7 @@ local function isVariableTypesValid(argument, argumentType, context, local variableType = query_util.typeFromAST(variableDefinition.type, context.schema) + local realVariableTypeName = util.getTypeName(variableType) if hasNonNullDefault and variableType.__type ~= 'NonNull' then variableType = types.nonNull(variableType) end @@ -527,7 +528,7 @@ local function isVariableTypesValid(argument, argumentType, context, if not isTypeSubTypeOf(variableType, argumentType, context) then return false, ('Variable "%s" type mismatch: the variable type "%s" ' .. 'is not compatible with the argument type "%s"'):format(variableName, - util.getTypeName(variableType), util.getTypeName(argumentType)) + realVariableTypeName, util.getTypeName(argumentType)) end elseif argument.value.kind == 'list' then -- find variables deeper From 1c286a5e3317210500413fb3e0819dec704deb7a Mon Sep 17 00:00:00 2001 From: Georgy Moiseev Date: Fri, 26 Aug 2022 13:29:55 +0300 Subject: [PATCH 7/7] Test argument and variable nullability Compare library with JS reference implementation in various nullability cases. This patch uses JS script to build various schemas and queries and execute them to generate luatest script that verifies that this library has the same behavior. To generate script, run ```bash cd ./tests/integration/codegen/fuzzing_nullability npm install node ./generate.js > ../../fuzzing_nullability_test.lua ``` Prior to this patch, several nullability behavior issues were fixed. There is some case that isn't yet fully covered by our library, refer to [1] for updates. Follow [2] for more test cases. Based on @no1seman PR [3]. 1. https://github.com/tarantool/graphql/issues/62 2. https://github.com/tarantool/graphql/issues/63 3. https://github.com/tarantool/graphql/pull/59 --- .gitignore | 2 +- .luacheckrc | 1 + Makefile | 2 +- test/helpers.lua | 36 + .../codegen/fuzzing_nullability/README.md | 10 + .../codegen/fuzzing_nullability/generate.js | 906 + .../fuzzing_nullability/package-lock.json | 13 + .../codegen/fuzzing_nullability/package.json | 14 + test/integration/fuzzing_nullability_test.lua | 152110 +++++++++++++++ test/integration/graphql_test.lua | 213 +- 10 files changed, 153185 insertions(+), 122 deletions(-) create mode 100644 test/helpers.lua create mode 100644 test/integration/codegen/fuzzing_nullability/README.md create mode 100644 test/integration/codegen/fuzzing_nullability/generate.js create mode 100644 test/integration/codegen/fuzzing_nullability/package-lock.json create mode 100644 test/integration/codegen/fuzzing_nullability/package.json create mode 100644 test/integration/fuzzing_nullability_test.lua diff --git a/.gitignore b/.gitignore index bc209ed..e81ae8b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ coverage_result.txt .DS_Store .vscode luacov.*.out* -/node_modules +**/node_modules /package-lock.json *.mo .history diff --git a/.luacheckrc b/.luacheckrc index 5ee11f2..1bfd886 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -8,6 +8,7 @@ include_files = { } exclude_files = { '.rocks', + 'test/integration/fuzzing_nullability_test.lua', } new_read_globals = { box = { fields = { diff --git a/Makefile b/Makefile index 5422048..b58f183 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ SHELL := /bin/bash .PHONY: .rocks .rocks: graphql-scm-1.rockspec Makefile tarantoolctl rocks make - tarantoolctl rocks install luatest 0.5.5 + tarantoolctl rocks install luatest 0.5.7 tarantoolctl rocks install luacov 0.13.0 tarantoolctl rocks install luacheck 0.26.0 diff --git a/test/helpers.lua b/test/helpers.lua new file mode 100644 index 0000000..b646154 --- /dev/null +++ b/test/helpers.lua @@ -0,0 +1,36 @@ +local types = require('graphql.types') +local schema = require('graphql.schema') +local parse = require('graphql.parse') +local validate = require('graphql.validate') +local execute = require('graphql.execute') + +local helpers = {} + +helpers.test_schema_name = 'default' + +function helpers.check_request(query, query_schema, mutation_schema, directives, opts) + opts = opts or {} + local root = { + query = types.object({ + name = 'Query', + fields = query_schema or {}, + }), + mutation = types.object({ + name = 'Mutation', + fields = mutation_schema or {}, + }), + directives = directives, + } + + local compiled_schema = schema.create(root, helpers.test_schema_name, opts) + + local parsed = parse.parse(query) + + validate.validate(compiled_schema, parsed) + + local rootValue = {} + local variables = opts.variables or {} + return execute.execute(compiled_schema, parsed, rootValue, variables) +end + +return helpers diff --git a/test/integration/codegen/fuzzing_nullability/README.md b/test/integration/codegen/fuzzing_nullability/README.md new file mode 100644 index 0000000..428a980 --- /dev/null +++ b/test/integration/codegen/fuzzing_nullability/README.md @@ -0,0 +1,10 @@ +To install dependencies, run +```bash +npm install +``` + +To generate test file, run +```bash +node generate.js > ../../fuzzing_nullability_test.lua +``` +in this directory. diff --git a/test/integration/codegen/fuzzing_nullability/generate.js b/test/integration/codegen/fuzzing_nullability/generate.js new file mode 100644 index 0000000..edf4c19 --- /dev/null +++ b/test/integration/codegen/fuzzing_nullability/generate.js @@ -0,0 +1,906 @@ +const { graphql, buildSchema } = require('graphql'); + +const nil = 'nil' +const box = {NULL: 'box.NULL'} + +const Nullable = 'Nullable' +const NonNullable = 'NonNullable' + +const graphql_types = { + "boolean_true": { + "var_type": 'Boolean', + "value": true, + "default": false, + }, + "boolean_false": { + "var_type": 'Boolean', + "value": false, + "default": true, + }, + "float": { + "var_type": 'Float', + "value": 1.1111111, + "default": 0, + }, + "int": { + "var_type": 'Int', + "value": 2**30, + "default": 0, + }, + "id": { + "var_type": 'ID', + "value": '00000000-0000-0000-0000-000000000000', + "default": '11111111-1111-1111-1111-111111111111', + }, + "enum": { + "graphql_type": ` + enum MyEnum { + a + b + } + `, + "var_type": 'MyEnum', + "value": `b`, + "default": `a`, + }, +} + +const Lua_to_JS_error = [ + { + "regex": /^"Expected value of type \\\"(?[a-zA-Z]+)\!\\\", found null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(${groups.type})\\\", got null"` + } + }, + { + "regex": /^"Expected value of type \\\"\[(?[a-zA-Z]+)\]\!\\\", found null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(List(${groups.type}))\\\", got null"` + } + }, + { + "regex": /^"Expected value of type \\\"\[(?[a-zA-Z]+)\!\]\\\", found null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"List(NonNull(${groups.type}))\\\", got null"` + } + }, + { + "regex": /^"Expected value of type \\\"\[(?[a-zA-Z]+)\!\]\!\\\", found null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(List(NonNull(${groups.type})))\\\", got null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of required type \\\"(?[a-zA-Z]+)\!\\\" was not provided\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of non-null type \\\"(?[a-zA-Z]+)\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"(?[a-zA-Z]+)\\\" used in position expecting type \\\"(?[a-zA-Z]+)\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"${groups.type1}\\\" is not compatible with the argument type \\\"NonNull(${groups.type2})\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" got invalid value null at \\\"var1\[0\]\\\"; Expected non-nullable type \\\"(?[a-zA-Z]+)\!\\\" not to be null\."$/, + "return": function(groups) { + return `"Variable \\\"var1[1]\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of non-null type \\\"\[(?[a-zA-Z]+)\!\]\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of required type \\\"\[(?[a-zA-Z]+)\!\]\!\\\" was not provided\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\]\!\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\!\]\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"NonNull(List(${groups.type1}))\\\" is not compatible with the argument type \\\"NonNull(List(NonNull(${groups.type2})))\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\!\]\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\!\]\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"List(NonNull(${groups.type1}))\\\" is not compatible with the argument type \\\"NonNull(List(NonNull(${groups.type2})))\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\]\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\!\]\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"List(${groups.type1})\\\" is not compatible with the argument type \\\"NonNull(List(NonNull(${groups.type2})))\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of non-null type \\\"\[(?[a-zA-Z]+)\]\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of required type \\\"\[(?[a-zA-Z]+)\]\!\\\" was not provided\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" expected to be non-null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\!\]\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\]\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"List(NonNull(${groups.type1}))\\\" is not compatible with the argument type \\\"NonNull(List(${groups.type2}))\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\]\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\]\!\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"List(${groups.type1})\\\" is not compatible with the argument type \\\"NonNull(List(${groups.type2}))\\\""` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\]\!\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\!\]\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"NonNull(List(${groups.type1}))\\\" is not compatible with the argument type \\\"List(NonNull(${groups.type2}))\\\""` + } + }, + { + "regex": /^"Argument \\\"arg1\\\" of non-null type \\\"(?[a-zA-Z]+)\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(${groups.type1})\\\", got null"` + } + }, + { + "regex": /^"Argument \\\"arg1\\\" of non-null type \\\"\[(?[a-zA-Z]+)\]\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(List(${groups.type1}))\\\", got null"` + } + }, + { + "regex": /^"Argument \\\"arg1\\\" of non-null type \\\"\[(?[a-zA-Z]+)\!\]\!\\\" must not be null\."$/, + "return": function(groups) { + return `"Expected non-null for \\\"NonNull(List(NonNull(${groups.type1})))\\\", got null"` + } + }, + { + "regex": /^"Variable \\\"\$var1\\\" of type \\\"\[(?[a-zA-Z]+)\]\\\" used in position expecting type \\\"\[(?[a-zA-Z]+)\!\]\\\"\."$/, + "return": function(groups) { + return `"Variable \\\"var1\\\" type mismatch: the variable type \\\"List(${groups.type1})\\\" is not compatible with the argument type \\\"List(NonNull(${groups.type2}))\\\""` + } + }, +] + +function JS_to_Lua_error_map_func(s) { + let j = 0 + for (j = 0; j < Lua_to_JS_error.length; j++) { + let found = s.match(Lua_to_JS_error[j].regex) + + if (found) { + return Lua_to_JS_error[j].return(found.groups) + } + } + + return s +} + +// == Build JS GraphQL objects == + +function get_JS_type_name(type) { + if (type == 'list') { + return 'list' + } + + if (graphql_types[type]) { + return graphql_types[type].var_type + } + + return undefined +} + +function get_JS_type_schema(type, inner_type) { + if (inner_type !== null) { + if (graphql_types[inner_type].graphql_type) { + return graphql_types[inner_type].graphql_type + } + + return '' + } + + if (graphql_types[type]) { + if (graphql_types[type].graphql_type) { + return graphql_types[type].graphql_type + } + return '' + } + + return '' +} + +function get_JS_nullability(nullability) { + if (nullability == NonNullable) { + return `!` + } else { + return `` + } +} + +function get_JS_type(type, nullability, + inner_type, inner_nullability) { + let js_type = get_JS_type_name(type) + let js_nullability = get_JS_nullability(nullability) + let js_inner_type = get_JS_type_name(inner_type) + let js_inner_nullability = get_JS_nullability(inner_nullability) + + if (js_type === 'list') { + return `[${js_inner_type}${js_inner_nullability}]${js_nullability}` + } else { + return `${js_type}${js_nullability}` + } +} + +function get_JS_value(type, inner_type, value, plain_nil_as_null) { + if (Array.isArray(value)) { + if (value[0] === nil) { + return `[]` + } else if (value[0] === box.NULL) { + return `[null]` + } else { + if (inner_type == 'enum') { + return `[${value}]` + } + return JSON.stringify(value) + } + } else { + if (value === nil) { + if (plain_nil_as_null) { + return `null` + } else { + return `` + } + } else if (value === box.NULL) { + return `null` + } else { + if (type == 'enum') { + return value + } + return JSON.stringify(value) + } + } +} + +function get_JS_default_value(type, inner_type, value) { + return get_JS_value(type, inner_type, value, false) +} + +function get_JS_argument_value(type, inner_type, value) { + return get_JS_value(type, inner_type, value, true) +} + +function build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) { + let argument_str = get_JS_type(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability) + let additional_schema = get_JS_type_schema(argument_type, argument_inner_type) + + var schema_str = `${additional_schema} + type result { + arg1: ${argument_str} + } + + type Query { + test(arg1: ${argument_str}): result + } + ` + + return schema_str; +}; + +function build_query(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) { + if (variable_type !== null) { + let variable_str = get_JS_type(variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability) + + let default_str = `` + let js_variable_default = get_JS_default_value(variable_type, variable_inner_type, variable_default) + if (js_variable_default !== ``) { + default_str = ` = ${js_variable_default}` + } + + return `query MyQuery($var1: ${variable_str}${default_str}) { test(arg1: $var1) { arg1 } }` + } else { + let js_argument_value = get_JS_argument_value(argument_type, argument_inner_type, argument_value) + return `query MyQuery { test(arg1: ${js_argument_value}) { arg1 } }` + } +}; + +function build_variables(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) { + let variables = []; + + if (Array.isArray(variable_value)) { + if (variable_value[0] == nil) { + return {var1: []} + } else if (variable_value[0] === box.NULL) { + return {var1: [null]} + } else { + return {var1: variable_value} + } + } + + if (variable_value !== nil) { + if (variable_value === box.NULL) { + return {var1: null} + } else { + return {var1: variable_value} + } + } + + return [] +} + +var rootValue = { + test: (args) => { + return args; + }, +}; + +// == Build Lua GraphQL objects == + +var test_header = `-- THIS FILE WAS GENERATED AUTOMATICALLY +-- See generator script at tests/integration/codegen/fuzzing_nullability +-- This test compares library behaviour with reference JavaScript GraphQL +-- implementation. Do not change it manually if the behaviour has changed, +-- please interact with code generation script. + +local json = require('json') +local types = require('graphql.types') + +local t = require('luatest') +local g = t.group('fuzzing_nullability') + +local helpers = require('test.helpers') + +-- constants +local Nullable = true +local NonNullable = false + +-- custom types +local my_enum = types.enum({ + name = 'MyEnum', + values = { + a = { value = 'a' }, + b = { value = 'b' }, + }, +}) + +local graphql_types = { + ['boolean_true'] = { + graphql_type = types.boolean, + var_type = 'Boolean', + value = true, + default = false, + }, + ['boolean_false'] = { + graphql_type = types.boolean, + var_type = 'Boolean', + value = false, + default = true, + }, + ['string'] = { + graphql_type = types.string, + var_type = 'String', + value = 'Test string', + default = 'Default Test string', + }, + ['float'] = { + graphql_type = types.float, + var_type = 'Float', + value = 1.1111111, + default = 0, + }, + ['int'] = { + graphql_type = types.int, + var_type = 'Int', + value = 2^30, + default = 0, + }, + ['id'] = { + graphql_type = types.id, + var_type = 'ID', + value = '00000000-0000-0000-0000-000000000000', + default = '11111111-1111-1111-1111-111111111111', + }, + ['enum'] = { + graphql_type = my_enum, + var_type = 'MyEnum', + value = 'b', + default = 'a', + }, + -- For more types follow https://github.com/tarantool/graphql/issues/63 +} + +local function build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + local type + if argument_type == 'list' then + if argument_inner_nullability == NonNullable then + type = types.list(types.nonNull(graphql_types[argument_inner_type].graphql_type)) + else + type = types.list(graphql_types[argument_inner_type].graphql_type) + end + if argument_nullability == NonNullable then + type = types.nonNull(type) + end + else + if argument_nullability == NonNullable then + type = types.nonNull(graphql_types[argument_type].graphql_type) + else + type = graphql_types[argument_type].graphql_type + end + end + + return { + ['test'] = { + kind = types.object({ + name = 'result', + fields = {arg1 = type} + }), + arguments = {arg1 = type}, + resolve = function(_, args) + return args + end, + } + } +end + +-- For more test cases follow https://github.com/tarantool/graphql/issues/63` +console.log(test_header) + +function to_Lua(v) { + if (v === null) { + return `nil` + } + + if (v === nil) { + return `${v}` + } + + if (v === box.NULL) { + return `${v}` + } + + if (v === Nullable) { + return `${v}` + } + + if (v === NonNullable) { + return `${v}` + } + + if (Array.isArray(v)) { + if (v[0] === nil) { + return '{}' + } else if (v[0] === box.NULL) { + return '{box.NULL}' + } else { + if (typeof v[0] === 'string' ) { + return `{'${v[0]}'}` + } + + return `{${v}}` + } + } + + if (typeof v === 'string' ) { + return `'${v}'` + } + + return `${v}` +} + +function build_test_case(response, suite_name, i, + argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default, + query, schema_str) { + let expected_data + + if (response.hasOwnProperty('data')) { + let _expected_data = JSON.stringify(response.data) + expected_data = `'${_expected_data}'` + } else { + expected_data = `nil` + } + + let expected_error + + if (response.hasOwnProperty('errors')) { + let _expected_error = JSON.stringify(response.errors[0].message) + expected_error = JS_to_Lua_error_map_func(`${_expected_error}`) + } else { + expected_error = `nil` + } + + let Lua_argument_type = to_Lua(argument_type) + let Lua_argument_nullability = to_Lua(argument_nullability) + let Lua_argument_inner_type = to_Lua(argument_inner_type) + let Lua_argument_inner_nullability = to_Lua(argument_inner_nullability) + + let Lua_variable_type = to_Lua(variable_type) + let Lua_variable_nullability = to_Lua(variable_nullability) + let Lua_variable_inner_type = to_Lua(variable_inner_type) + let Lua_variable_inner_nullability = to_Lua(variable_inner_nullability) + + + let Lua_variable_default = to_Lua(variable_default) + let Lua_argument_value = to_Lua(argument_value) + let Lua_variable_value = to_Lua(variable_value) + + let type_in_name + if (argument_inner_type !== null) { + type_in_name = argument_inner_type + } else { + type_in_name = argument_type + } + + return ` +g.test_${suite_name}_${type_in_name}_${i} = function(g) + local argument_type = ${Lua_argument_type} + local argument_nullability = ${Lua_argument_nullability} + local argument_inner_type = ${Lua_argument_inner_type} + local argument_inner_nullability = ${Lua_argument_inner_nullability} + local argument_value = ${Lua_argument_value} + local variable_type = ${Lua_variable_type} + local variable_nullability = ${Lua_variable_nullability} + local variable_inner_type = ${Lua_variable_inner_type} + local variable_inner_nullability = ${Lua_variable_inner_nullability} + local variable_default = ${Lua_variable_default} + local variable_value = ${Lua_variable_value} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[${schema_str}]] + + local query = '${query}' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = ${expected_data} + local expected_error_json = ${expected_error} + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end` +} + +async function build_suite(suite_name, + argument_type, argument_nullabilities, + argument_inner_type, argument_inner_nullabilities, + argument_values, + variable_type, variable_nullabilities, + variable_inner_type, variable_inner_nullabilities, + variable_values, + variable_defaults) { + let i = 0 + + if (argument_inner_nullabilities.length == 0) { + // Non-list case + let argument_inner_nullability = null + let variable_inner_nullability = null + + if (variable_type == null) { + // No variables case + let variable_nullability = null + let variable_value = null + let variable_default = null + + argument_nullabilities.forEach( async function (argument_nullability) { + argument_values.forEach( async function (argument_value) { + let schema_str = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + let schema = buildSchema(schema_str) + + let query = build_query(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + + await graphql({ + schema, + source: query, + rootValue, + }).then((response) => { + i = i + 1 + console.log(build_test_case(response, suite_name, i, + argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default, + query, schema_str)) + }) + }) + }) + } else { + // Variables case + argument_nullabilities.forEach( async function (argument_nullability) { + variable_nullabilities.forEach( async function (variable_nullability) { + variable_values.forEach( async function (variable_value) { + variable_defaults.forEach( async function (variable_default) { + let argument_value = null + + let schema_str = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + let schema = buildSchema(schema_str) + + let query = build_query(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + let variables = build_variables(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + + await graphql({ + schema, + source: query, + rootValue, + variableValues: variables + }).then((response) => { + i = i + 1 + console.log(build_test_case(response, suite_name, i, + argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default, + query, schema_str)) + }) + }) + }) + }) + }) + } + + return + } + + // List case + if (variable_type == null) { + argument_nullabilities.forEach( async function (argument_nullability) { + argument_inner_nullabilities.forEach( async function (argument_inner_nullability) { + argument_values.forEach( async function (argument_value) { + let variable_nullability = null + let variable_inner_nullability = null + let variable_value = null + let variable_default = null + + let schema_str = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + let schema = buildSchema(schema_str) + + let query = build_query(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + await graphql({ + schema, + source: query, + rootValue, + }).then((response) => { + i = i + 1 + console.log(build_test_case(response, suite_name, i, + argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default, + query, schema_str)) + }) + }) + }) + }) + } else { + argument_nullabilities.forEach( async function (argument_nullability) { + argument_inner_nullabilities.forEach( async function (argument_inner_nullability) { + variable_nullabilities.forEach( async function (variable_nullability) { + variable_inner_nullabilities.forEach( async function (variable_inner_nullability) { + variable_values.forEach( async function (variable_value) { + variable_defaults.forEach( async function (variable_default) { + let argument_value = null + + let schema_str = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + let schema = buildSchema(schema_str) + + let query = build_query(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + let variables = build_variables(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + await graphql({ + schema, + source: query, + rootValue, + variableValues: variables + }).then((response) => { + i = i + 1 + console.log(build_test_case(response, suite_name, i, + argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default, + query, schema_str)) + }) + }) + }) + }) + }) + }) + }) + } +} + +let type +let type_desc + +// == Non-list argument nullability == +// +// There is no way pass no value to the argument +// since `test(arg1)` is invalid syntax. +// We use `test(arg1: null)` for both nil and box.NULL, +// so the behavior will be the same for them. + +Object.keys(graphql_types).forEach( (type) => { + let type_desc = graphql_types[type] + + build_suite('nonlist_argument_nullability', + type, [Nullable, NonNullable], + null, [], + [nil, box.NULL, type_desc.value], + null, [], + null, [], + [], + []) +}) + +// == List argument nullability == +// +// {nil} is the same as {} in Lua. + +Object.keys(graphql_types).forEach( (type) => { + let type_desc = graphql_types[type] + + build_suite('list_argument_nullability', + 'list', [Nullable, NonNullable], + type, [Nullable, NonNullable], + [nil, box.NULL, [nil], [box.NULL], [type_desc.value]], + null, [], + null, [], + [], + []) +}) + +// == Non-list argument with variable nullability == + +Object.keys(graphql_types).forEach( (type) => { + let type_desc = graphql_types[type] + + build_suite('nonlist_argument_with_variables_nullability', + type, [Nullable, NonNullable], + null, [], + [], + type, [Nullable, NonNullable], + null, [], + [nil, box.NULL, type_desc.value], + [nil, box.NULL, type_desc.default]) +}) + +// == List argument with variable nullability == +// +// {nil} is the same as {} in Lua. + +Object.keys(graphql_types).forEach( (type) => { + let type_desc = graphql_types[type] + + + build_suite('list_argument_with_variables_nullability', + 'list', [Nullable, NonNullable], + type, [Nullable, NonNullable], + [], + 'list', [Nullable, NonNullable], + type, [Nullable, NonNullable], + [nil, box.NULL, [nil], [box.NULL], [type_desc.value]], + [nil, box.NULL, [nil], [box.NULL], [type_desc.default]]) +}) diff --git a/test/integration/codegen/fuzzing_nullability/package-lock.json b/test/integration/codegen/fuzzing_nullability/package-lock.json new file mode 100644 index 0000000..9cd9fcb --- /dev/null +++ b/test/integration/codegen/fuzzing_nullability/package-lock.json @@ -0,0 +1,13 @@ +{ + "name": "fuzzing_nullability", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "graphql": { + "version": "15.8.0", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-15.8.0.tgz", + "integrity": "sha512-5gghUc24tP9HRznNpV2+FIoq3xKkj5dTQqf4v0CpdPbFVwFkWoxOM+o+2OC9ZSvjEMTjfmG9QT+gcvggTwW1zw==" + } + } +} diff --git a/test/integration/codegen/fuzzing_nullability/package.json b/test/integration/codegen/fuzzing_nullability/package.json new file mode 100644 index 0000000..808ac31 --- /dev/null +++ b/test/integration/codegen/fuzzing_nullability/package.json @@ -0,0 +1,14 @@ +{ + "name": "fuzzing_nullability", + "version": "1.0.0", + "description": "", + "main": "generate.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "graphql": "^15.8.0" + } +} diff --git a/test/integration/fuzzing_nullability_test.lua b/test/integration/fuzzing_nullability_test.lua new file mode 100644 index 0000000..358ad7b --- /dev/null +++ b/test/integration/fuzzing_nullability_test.lua @@ -0,0 +1,152110 @@ +-- THIS FILE WAS GENERATED AUTOMATICALLY +-- See generator script at tests/integration/codegen/fuzzing_nullability +-- This test compares library behaviour with reference JavaScript GraphQL +-- implementation. Do not change it manually if the behaviour has changed, +-- please interact with code generation script. + +local json = require('json') +local types = require('graphql.types') + +local t = require('luatest') +local g = t.group('fuzzing_nullability') + +local helpers = require('test.helpers') + +-- constants +local Nullable = true +local NonNullable = false + +-- custom types +local my_enum = types.enum({ + name = 'MyEnum', + values = { + a = { value = 'a' }, + b = { value = 'b' }, + }, +}) + +local graphql_types = { + ['boolean_true'] = { + graphql_type = types.boolean, + var_type = 'Boolean', + value = true, + default = false, + }, + ['boolean_false'] = { + graphql_type = types.boolean, + var_type = 'Boolean', + value = false, + default = true, + }, + ['string'] = { + graphql_type = types.string, + var_type = 'String', + value = 'Test string', + default = 'Default Test string', + }, + ['float'] = { + graphql_type = types.float, + var_type = 'Float', + value = 1.1111111, + default = 0, + }, + ['int'] = { + graphql_type = types.int, + var_type = 'Int', + value = 2^30, + default = 0, + }, + ['id'] = { + graphql_type = types.id, + var_type = 'ID', + value = '00000000-0000-0000-0000-000000000000', + default = '11111111-1111-1111-1111-111111111111', + }, + ['enum'] = { + graphql_type = my_enum, + var_type = 'MyEnum', + value = 'b', + default = 'a', + }, + -- For more types follow https://github.com/tarantool/graphql/issues/63 +} + +local function build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + local type + if argument_type == 'list' then + if argument_inner_nullability == NonNullable then + type = types.list(types.nonNull(graphql_types[argument_inner_type].graphql_type)) + else + type = types.list(graphql_types[argument_inner_type].graphql_type) + end + if argument_nullability == NonNullable then + type = types.nonNull(type) + end + else + if argument_nullability == NonNullable then + type = types.nonNull(graphql_types[argument_type].graphql_type) + else + type = graphql_types[argument_type].graphql_type + end + end + + return { + ['test'] = { + kind = types.object({ + name = 'result', + fields = {arg1 = type} + }), + arguments = {arg1 = type}, + resolve = function(_, args) + return args + end, + } + } +end + +-- For more test cases follow https://github.com/tarantool/graphql/issues/63 + +g.test_nonlist_argument_nullability_boolean_true_1 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_true_2 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_true_3 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = true + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: true) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_true_4 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_true_5 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_true_6 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = true + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: true) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_1 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_2 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_3 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = false + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery { test(arg1: false) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_4 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_5 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_boolean_false_6 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = false + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery { test(arg1: false) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_1 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_2 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_3 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 1.1111111 + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery { test(arg1: 1.1111111) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_4 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_5 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_float_6 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 1.1111111 + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery { test(arg1: 1.1111111) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_1 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_2 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_3 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 1073741824 + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery { test(arg1: 1073741824) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_4 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_5 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_int_6 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 1073741824 + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery { test(arg1: 1073741824) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_1 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_2 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_3 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = '00000000-0000-0000-0000-000000000000' + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery { test(arg1: "00000000-0000-0000-0000-000000000000") { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_4 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_5 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_id_6 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = '00000000-0000-0000-0000-000000000000' + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery { test(arg1: "00000000-0000-0000-0000-000000000000") { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_1 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_2 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_3 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 'b' + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery { test(arg1: b) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_4 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_5 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_nullability_enum_6 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = 'b' + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery { test(arg1: b) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {true} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [true]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {true} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [true]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = {true} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [true]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_true_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = {true} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [true]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {false} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [false]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {false} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [false]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = {false} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [false]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_boolean_false_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = {false} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [false]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {1.1111111} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1.1111111]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {1.1111111} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1.1111111]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = {1.1111111} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1.1111111]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_float_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = {1.1111111} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1.1111111]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {1073741824} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1073741824]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {1073741824} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1073741824]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = {1073741824} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1073741824]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_int_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = {1073741824} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [1073741824]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {'00000000-0000-0000-0000-000000000000'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery { test(arg1: ["00000000-0000-0000-0000-000000000000"]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {'00000000-0000-0000-0000-000000000000'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: ["00000000-0000-0000-0000-000000000000"]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = {'00000000-0000-0000-0000-000000000000'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: ["00000000-0000-0000-0000-000000000000"]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_id_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = {'00000000-0000-0000-0000-000000000000'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: ["00000000-0000-0000-0000-000000000000"]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {'b'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [b]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {'b'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery { test(arg1: [b]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_11 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_12 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_13 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_14 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_15 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = {'b'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [b]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_16 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_17 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = box.NULL + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: null) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_18 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: []) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_19 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {box.NULL} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [null]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_nullability_enum_20 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = {'b'} + local variable_type = nil + local variable_nullability = nil + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery { test(arg1: [b]) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_1 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_2 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_3 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_4 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_5 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_6 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_7 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_8 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_9 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_10 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_11 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_12 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_13 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_14 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_15 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_16 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_17 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_18 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_19 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_20 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_21 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_22 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_23 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_24 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_25 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_26 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_27 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_28 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_29 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_30 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_31 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_32 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_33 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_34 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_35 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_true_36 = function(g) + local argument_type = 'boolean_true' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_true' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = false + local variable_value = true + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = false) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_1 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_2 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_3 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_4 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_5 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_6 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_7 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_8 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_9 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_10 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_11 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_12 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_13 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_14 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_15 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_16 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_17 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_18 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean + } + + type Query { + test(arg1: Boolean): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_19 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_20 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_21 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_22 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_23 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_24 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_25 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_26 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Boolean\" is not compatible with the argument type \"NonNull(Boolean)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_27 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_28 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_29 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_30 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":true}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_31 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_32 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_33 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_34 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_35 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_boolean_false_36 = function(g) + local argument_type = 'boolean_false' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'boolean_false' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = true + local variable_value = false + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Boolean! + } + + type Query { + test(arg1: Boolean!): result + } + ]] + + local query = 'query MyQuery($var1: Boolean! = true) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":false}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_1 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_2 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_3 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_4 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_5 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_6 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_7 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_8 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_9 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_10 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_11 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_12 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_13 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_14 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_15 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_16 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_17 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_18 = function(g) + local argument_type = 'float' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float + } + + type Query { + test(arg1: Float): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_19 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_20 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_21 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_22 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_23 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_24 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_25 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_26 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Float\" is not compatible with the argument type \"NonNull(Float)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_27 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_28 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_29 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_30 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_31 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_32 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_33 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_34 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_35 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_float_36 = function(g) + local argument_type = 'float' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'float' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1.1111111 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Float! + } + + type Query { + test(arg1: Float!): result + } + ]] + + local query = 'query MyQuery($var1: Float! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1.1111111}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_1 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_2 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_3 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_4 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_5 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_6 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_7 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_8 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_9 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_10 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_11 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_12 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_13 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_14 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_15 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_16 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_17 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_18 = function(g) + local argument_type = 'int' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int + } + + type Query { + test(arg1: Int): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_19 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_20 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_21 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_22 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_23 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_24 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_25 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_26 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"Int\" is not compatible with the argument type \"NonNull(Int)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_27 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_28 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_29 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_30 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":0}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_31 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_32 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_33 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_34 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_35 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_int_36 = function(g) + local argument_type = 'int' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'int' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 0 + local variable_value = 1073741824 + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: Int! + } + + type Query { + test(arg1: Int!): result + } + ]] + + local query = 'query MyQuery($var1: Int! = 0) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":1073741824}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_1 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_2 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_3 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"11111111-1111-1111-1111-111111111111"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_4 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_5 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_6 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_7 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_8 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_9 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_10 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_11 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_12 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"11111111-1111-1111-1111-111111111111"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_13 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_14 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_15 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_16 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_17 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_18 = function(g) + local argument_type = 'id' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID + } + + type Query { + test(arg1: ID): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_19 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_20 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_21 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"11111111-1111-1111-1111-111111111111"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_22 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_23 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_24 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_25 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_26 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"ID\" is not compatible with the argument type \"NonNull(ID)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_27 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_28 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_29 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_30 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"11111111-1111-1111-1111-111111111111"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_31 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_32 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_33 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_34 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_35 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_id_36 = function(g) + local argument_type = 'id' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'id' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = '11111111-1111-1111-1111-111111111111' + local variable_value = '00000000-0000-0000-0000-000000000000' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: ID! + } + + type Query { + test(arg1: ID!): result + } + ]] + + local query = 'query MyQuery($var1: ID! = "11111111-1111-1111-1111-111111111111") { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"00000000-0000-0000-0000-000000000000"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_1 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_2 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_3 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"a"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_4 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_5 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_6 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_7 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_8 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_9 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_10 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_11 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_12 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"a"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_13 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_14 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_15 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_16 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_17 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_18 = function(g) + local argument_type = 'enum' + local argument_nullability = Nullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum + } + + type Query { + test(arg1: MyEnum): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_19 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_20 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_21 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"a"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_22 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_23 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_24 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_25 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_26 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"MyEnum\" is not compatible with the argument type \"NonNull(MyEnum)\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_27 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = Nullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_28 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_29 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_30 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"a"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_31 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_32 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_33 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_34 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = nil + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_35 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = box.NULL + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_nonlist_argument_with_variables_nullability_enum_36 = function(g) + local argument_type = 'enum' + local argument_nullability = NonNullable + local argument_inner_type = nil + local argument_inner_nullability = nil + local argument_value = nil + local variable_type = 'enum' + local variable_nullability = NonNullable + local variable_inner_type = nil + local variable_inner_nullability = nil + local variable_default = 'a' + local variable_value = 'b' + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: MyEnum! + } + + type Query { + test(arg1: MyEnum!): result + } + ]] + + local query = 'query MyQuery($var1: MyEnum! = a) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":"b"}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = Nullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_true_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_true' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_true' + local variable_inner_nullability = NonNullable + local variable_default = {false} + local variable_value = {true} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [false]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean] + } + + type Query { + test(arg1: [Boolean]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"List(NonNull(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!] + } + + type Query { + test(arg1: [Boolean!]): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(Boolean))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean]! + } + + type Query { + test(arg1: [Boolean]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Boolean)\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!] = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Boolean))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = Nullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Boolean))\" is not compatible with the argument type \"NonNull(List(NonNull(Boolean)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[true]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Boolean)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Boolean)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_boolean_false_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'boolean_false' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'boolean_false' + local variable_inner_nullability = NonNullable + local variable_default = {true} + local variable_value = {false} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Boolean!]! + } + + type Query { + test(arg1: [Boolean!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Boolean!]! = [true]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[false]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float] + } + + type Query { + test(arg1: [Float]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"List(NonNull(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!] + } + + type Query { + test(arg1: [Float!]): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(Float))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float]! + } + + type Query { + test(arg1: [Float]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Float)\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Float))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Float))\" is not compatible with the argument type \"NonNull(List(NonNull(Float)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Float)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Float)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_float_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'float' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'float' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1.1111111} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Float!]! + } + + type Query { + test(arg1: [Float!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Float!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1.1111111]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int] + } + + type Query { + test(arg1: [Int]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"List(NonNull(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!] + } + + type Query { + test(arg1: [Int!]): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(Int))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int]! + } + + type Query { + test(arg1: [Int]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(Int)\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!] = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(Int))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = Nullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(Int))\" is not compatible with the argument type \"NonNull(List(NonNull(Int)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[0]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(Int)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(Int)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_int_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'int' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'int' + local variable_inner_nullability = NonNullable + local variable_default = {0} + local variable_value = {1073741824} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [Int!]! + } + + type Query { + test(arg1: [Int!]!): result + } + ]] + + local query = 'query MyQuery($var1: [Int!]! = [0]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[1073741824]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID] + } + + type Query { + test(arg1: [ID]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"List(NonNull(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!] + } + + type Query { + test(arg1: [ID!]): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(ID))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID]! + } + + type Query { + test(arg1: [ID]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(ID)\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!] = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(ID))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = Nullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(ID))\" is not compatible with the argument type \"NonNull(List(NonNull(ID)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["11111111-1111-1111-1111-111111111111"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(ID)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(ID)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_id_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'id' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'id' + local variable_inner_nullability = NonNullable + local variable_default = {'11111111-1111-1111-1111-111111111111'} + local variable_value = {'00000000-0000-0000-0000-000000000000'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + type result { + arg1: [ID!]! + } + + type Query { + test(arg1: [ID!]!): result + } + ]] + + local query = 'query MyQuery($var1: [ID!]! = ["11111111-1111-1111-1111-111111111111"]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["00000000-0000-0000-0000-000000000000"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_1 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_2 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_3 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_4 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_5 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_6 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_7 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_8 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_9 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_10 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_11 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_12 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_13 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_14 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_15 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_16 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_17 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_18 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_19 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_20 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_21 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_22 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_23 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_24 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_25 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_26 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_27 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_28 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_29 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_30 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_31 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_32 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_33 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_34 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_35 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_36 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_37 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_38 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_39 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_40 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_41 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_42 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_43 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_44 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_45 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_46 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_47 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_48 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_49 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_50 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_51 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_52 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_53 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_54 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_55 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_56 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_57 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_58 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_59 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_60 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_61 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_62 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_63 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_64 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_65 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_66 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_67 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_68 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_69 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_70 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_71 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_72 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_73 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_74 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_75 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_76 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_77 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_78 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_79 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_80 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_81 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_82 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_83 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_84 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_85 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_86 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_87 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_88 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_89 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_90 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_91 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_92 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_93 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_94 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_95 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_96 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_97 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_98 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_99 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_100 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum] + } + + type Query { + test(arg1: [MyEnum]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_101 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_102 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_103 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_104 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_105 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_106 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_107 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_108 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_109 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_110 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_111 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_112 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_113 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_114 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_115 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_116 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_117 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_118 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_119 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_120 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_121 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_122 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_123 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_124 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_125 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_126 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_127 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_128 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_129 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_130 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_131 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_132 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_133 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_134 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_135 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":null}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_136 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_137 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_138 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_139 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_140 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_141 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_142 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_143 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_144 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_145 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_146 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_147 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_148 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_149 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_150 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_151 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_152 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_153 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_154 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_155 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_156 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_157 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_158 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_159 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_160 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_161 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_162 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_163 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_164 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_165 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_166 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_167 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_168 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_169 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_170 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_171 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_172 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_173 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_174 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_175 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"List(NonNull(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_176 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_177 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_178 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_179 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_180 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_181 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_182 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_183 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_184 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_185 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_186 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_187 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_188 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_189 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_190 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_191 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_192 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_193 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_194 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_195 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_196 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_197 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_198 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_199 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_200 = function(g) + local argument_type = 'list' + local argument_nullability = Nullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!] + } + + type Query { + test(arg1: [MyEnum!]): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_201 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_202 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_203 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_204 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_205 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_206 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_207 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_208 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_209 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_210 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_211 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_212 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_213 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_214 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_215 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_216 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_217 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_218 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_219 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_220 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_221 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_222 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_223 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_224 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_225 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_226 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_227 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_228 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_229 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_230 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_231 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_232 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_233 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_234 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_235 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_236 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_237 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_238 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_239 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_240 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_241 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_242 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_243 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_244 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_245 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_246 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_247 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(MyEnum))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_248 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_249 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_250 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_251 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_252 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_253 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_254 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_255 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_256 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_257 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_258 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_259 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_260 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_261 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_262 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_263 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_264 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_265 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_266 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_267 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_268 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_269 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_270 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[null]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_271 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_272 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_273 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_274 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_275 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_276 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_277 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_278 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_279 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_280 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_281 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_282 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_283 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_284 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_285 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_286 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_287 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_288 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_289 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_290 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_291 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_292 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_293 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_294 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_295 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_296 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_297 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_298 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_299 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_300 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = Nullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum]! + } + + type Query { + test(arg1: [MyEnum]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_301 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_302 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_303 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_304 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_305 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_306 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_307 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_308 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_309 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_310 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_311 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_312 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_313 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_314 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_315 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_316 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_317 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_318 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_319 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_320 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_321 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_322 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_323 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_324 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_325 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(MyEnum)\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_326 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_327 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_328 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_329 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_330 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_331 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_332 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_333 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_334 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_335 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":null}' + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_336 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_337 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_338 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_339 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_340 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_341 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_342 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_343 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_344 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_345 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_346 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_347 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"List(NonNull(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_348 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_349 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_350 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = Nullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!] = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_351 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_352 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_353 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_354 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_355 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_356 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_357 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_358 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_359 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_360 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_361 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_362 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_363 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_364 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_365 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_366 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_367 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_368 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_369 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_370 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_371 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_372 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(MyEnum))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_373 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_374 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_375 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = Nullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" type mismatch: the variable type \"NonNull(List(MyEnum))\" is not compatible with the argument type \"NonNull(List(NonNull(MyEnum)))\"" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_376 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_377 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_378 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_379 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_380 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = nil + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["a"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_381 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_382 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_383 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_384 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_385 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = box.NULL + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_386 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_387 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_388 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_389 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_390 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":[]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_391 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_392 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_393 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_394 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_395 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {box.NULL} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Variable \"var1[1]\" expected to be non-null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_396 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = nil + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]!) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_397 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = box.NULL + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = null) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(List(NonNull(MyEnum)))\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_398 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = []) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_399 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {box.NULL} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [null]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = nil + local expected_error_json = "Expected non-null for \"NonNull(MyEnum)\", got null" + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end + +g.test_list_argument_with_variables_nullability_enum_400 = function(g) + local argument_type = 'list' + local argument_nullability = NonNullable + local argument_inner_type = 'enum' + local argument_inner_nullability = NonNullable + local argument_value = nil + local variable_type = 'list' + local variable_nullability = NonNullable + local variable_inner_type = 'enum' + local variable_inner_nullability = NonNullable + local variable_default = {'a'} + local variable_value = {'b'} + + local query_schema = build_schema(argument_type, argument_nullability, + argument_inner_type, argument_inner_nullability, + argument_value, + variable_type, variable_nullability, + variable_inner_type, variable_inner_nullability, + variable_value, variable_default) + + -- There is no explicit check that Lua query_schema is the same as JS query_schema. + local reference_schema = [[ + enum MyEnum { + a + b + } + + type result { + arg1: [MyEnum!]! + } + + type Query { + test(arg1: [MyEnum!]!): result + } + ]] + + local query = 'query MyQuery($var1: [MyEnum!]! = [a]) { test(arg1: $var1) { arg1 } }' + + local ok, res = pcall(helpers.check_request, query, query_schema, nil, nil, { variables = { var1 = variable_value }}) + + local result, err + if ok then + result = json.encode(res) + else + err = res + end + + local expected_data_json = '{"test":{"arg1":["b"]}}' + local expected_error_json = nil + + if expected_error_json ~= nil and expected_data_json ~= nil then + t.assert_equals(err, expected_error_json) + t.xfail('See https://github.com/tarantool/graphql/issues/62') + end + + t.assert_equals(result, expected_data_json) + t.assert_equals(err, expected_error_json) +end diff --git a/test/integration/graphql_test.lua b/test/integration/graphql_test.lua index b8dc12e..48552b2 100644 --- a/test/integration/graphql_test.lua +++ b/test/integration/graphql_test.lua @@ -1,40 +1,13 @@ local json = require('json') local types = require('graphql.types') local schema = require('graphql.schema') -local parse = require('graphql.parse') -local validate = require('graphql.validate') -local execute = require('graphql.execute') local util = require('graphql.util') -local introspection = require('test.integration.introspection') local t = require('luatest') local g = t.group('integration') -local test_schema_name = 'default' -local function check_request(query, query_schema, mutation_schema, directives, opts) - opts = opts or {} - local root = { - query = types.object({ - name = 'Query', - fields = query_schema or {}, - }), - mutation = types.object({ - name = 'Mutation', - fields = mutation_schema or {}, - }), - directives = directives, - } - - local compiled_schema = schema.create(root, test_schema_name, opts) - - local parsed = parse.parse(query) - - validate.validate(compiled_schema, parsed) - - local rootValue = {} - local variables = opts.variables or {} - return execute.execute(compiled_schema, parsed, rootValue, variables) -end +local helpers = require('test.helpers') +local introspection = require('test.integration.introspection') function g.test_simple() local query = [[ @@ -58,7 +31,7 @@ function g.test_simple() } } - t.assert_equals(check_request(query, query_schema), {test = 'A'}) + t.assert_equals(helpers.check_request(query, query_schema), {test = 'A'}) end function g.test_args_order() @@ -83,8 +56,8 @@ function g.test_args_order() } } - t.assert_equals(check_request([[{ test(arg: "B", arg2: "22") }]], query_schema), {test = 'B22'}) - t.assert_equals(check_request([[{ test(arg2: "22", arg: "B") }]], query_schema), {test = '22B'}) + t.assert_equals(helpers.check_request([[{ test(arg: "B", arg2: "22") }]], query_schema), {test = 'B22'}) + t.assert_equals(helpers.check_request([[{ test(arg2: "22", arg: "B") }]], query_schema), {test = '22B'}) end function g.test_variables() @@ -115,7 +88,7 @@ function g.test_variables() } -- Positive test - t.assert_equals(check_request(query, query_schema, nil, nil, {variables = variables}), {test = 'B22'}) + t.assert_equals(helpers.check_request(query, query_schema, nil, nil, {variables = variables}), {test = 'B22'}) -- Negative tests local query = [[ @@ -125,7 +98,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Variable "arg2" expected to be non-null', function() - check_request(query, query_schema, nil, nil, {variables = {}}) + helpers.check_request(query, query_schema, nil, nil, {variables = {}}) end ) @@ -138,28 +111,28 @@ function g.test_variables() ' the variable type "String" is not compatible' .. ' with the argument type "NonNull(String)"', function() - check_request(query, query_schema, nil, nil, {variables = {}}) + helpers.check_request(query, query_schema, nil, nil, {variables = {}}) end ) t.assert_error_msg_equals( 'Required argument "arg" was not supplied.', function() - check_request([[ query { test(arg2: "") } ]], query_schema) + helpers.check_request([[ query { test(arg2: "") } ]], query_schema) end ) t.assert_error_msg_equals( 'Unknown variable "unknown_arg"', function() - check_request([[ query { test(arg: $unknown_arg) } ]], query_schema) + helpers.check_request([[ query { test(arg: $unknown_arg) } ]], query_schema) end ) t.assert_error_msg_equals( 'There is no declaration for the variable "unknown_arg"', function() - check_request([[ + helpers.check_request([[ query { test(arg: "") } ]], query_schema, nil, nil, { variables = {unknown_arg = ''}}) end @@ -168,7 +141,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "8589934592" to type "Int"', function() - check_request([[ + helpers.check_request([[ query { test(arg: "", arg3: 8589934592) } ]], query_schema) end @@ -177,7 +150,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "123.4" to type "Int"', function() - check_request([[ + helpers.check_request([[ query { test(arg: "", arg3: 123.4) } ]], query_schema) end @@ -186,7 +159,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "18446744073709551617" to type "Long"', function() - check_request([[ + helpers.check_request([[ query { test(arg: "", arg4: 18446744073709551617) } ]], query_schema) end @@ -195,7 +168,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "123.4" to type "Long"', function() - check_request([[ + helpers.check_request([[ query { test(arg: "", arg4: 123.4) } ]], query_schema) end @@ -204,7 +177,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "inputObject" to type "String"', function() - check_request([[ + helpers.check_request([[ query { test(arg: {a: "123"}, arg4: 123) } ]], query_schema) end @@ -213,7 +186,7 @@ function g.test_variables() t.assert_error_msg_equals( 'Could not coerce value "list" to type "String"', function() - check_request([[ + helpers.check_request([[ query { test(arg: ["123"], arg4: 123) } ]], query_schema) end @@ -240,7 +213,7 @@ function g.test_error_in_handlers() t.assert_error_msg_equals( 'Error C', function() - check_request([[ + helpers.check_request([[ { test(arg: "TEST") } ]], query_schema) end @@ -253,7 +226,7 @@ function g.test_error_in_handlers() t.assert_error_msg_equals( 'Error E', function() - check_request([[ + helpers.check_request([[ { test(arg: "TEST") } ]], query_schema) end @@ -284,7 +257,7 @@ function g.test_subselections() t.assert_error_msg_equals( 'Scalar field "uri" cannot have subselections', function() - check_request([[ + helpers.check_request([[ { test(arg: "") { uri { id } } } ]], query_schema) end @@ -293,7 +266,7 @@ function g.test_subselections() t.assert_error_msg_equals( 'Composite field "uris" must have subselections', function() - check_request([[ + helpers.check_request([[ { test(arg: "") { uris } } ]], query_schema) end @@ -302,7 +275,7 @@ function g.test_subselections() t.assert_error_msg_equals( 'Field "unknown" is not defined on type "selection"', function() - check_request([[ + helpers.check_request([[ { test(arg: "") { unknown } } ]], query_schema) end @@ -336,7 +309,7 @@ function g.test_enum_input() } } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: simple_input_object) { simple_enum(arg: $arg) } @@ -345,7 +318,7 @@ function g.test_enum_input() t.assert_error_msg_equals( 'Wrong variable "arg.field" for the Enum "simple_enum" with value "d"', function() - check_request([[ + helpers.check_request([[ query($arg: simple_input_object) { simple_enum(arg: $arg) } @@ -380,7 +353,7 @@ function g.test_enum_output() } } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query { test_enum_output{ value } } @@ -391,7 +364,7 @@ function g.test_unknown_query_mutation() t.assert_error_msg_equals( 'Field "UNKNOWN_TYPE" is not defined on type "Query"', function() - check_request([[ + helpers.check_request([[ query { UNKNOWN_TYPE(arg: "") } ]], {}) end @@ -400,7 +373,7 @@ function g.test_unknown_query_mutation() t.assert_error_msg_equals( 'Field "UNKNOWN_TYPE" is not defined on type "Mutation"', function() - check_request([[ + helpers.check_request([[ mutation { UNKNOWN_TYPE(arg: "") } ]], {}) end @@ -457,7 +430,7 @@ function g.test_nested_input() }, } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: String!) { test_nested_InputObject( servers: [{ field: $field }] @@ -468,7 +441,7 @@ function g.test_nested_input() t.assert_error_msg_equals( 'Unused variable "field"', function() - check_request([[ + helpers.check_request([[ query($field: String!) { test_nested_InputObject( servers: [{ field: "not-variable" }] @@ -478,7 +451,7 @@ function g.test_nested_input() end ) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: String!) { test_nested_list( servers: [$field] @@ -486,7 +459,7 @@ function g.test_nested_input() } ]], query_schema, nil, nil, {variables = {field = 'echo'}}), {test_nested_list = 'echo'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: String! $field2: String! $upvalue: String!) { test_nested_InputObject_complex( upvalue: $upvalue, @@ -632,7 +605,7 @@ function g.test_custom_type_scalar_variables() }, } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: Json) { test_json_type( field: $field @@ -642,7 +615,7 @@ function g.test_custom_type_scalar_variables() variables = {field = '{"test": 123}'}, }), {test_json_type = '{"test":123}'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: Json) { test_json_type( field: $field @@ -652,7 +625,7 @@ function g.test_custom_type_scalar_variables() variables = {field = box.NULL}, }), {test_json_type = 'null'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($array: [Json]) { test_json_type_list( array: $array @@ -662,7 +635,7 @@ function g.test_custom_type_scalar_variables() variables = {array = {json.encode({test = 123})}}, }), {test_json_type_list = {'{"test":123}'}}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query { test_json_type( field: "null" @@ -672,7 +645,7 @@ function g.test_custom_type_scalar_variables() variables = {}, }), {test_json_type = 'null'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: CustomString!) { test_custom_type_scalar( field: $field @@ -687,7 +660,7 @@ function g.test_custom_type_scalar_variables() 'the variable type "NonNull(String)" is not compatible with the argument type '.. '"NonNull(CustomString)"', function() - check_request([[ + helpers.check_request([[ query($field: String!) { test_custom_type_scalar( field: $field @@ -697,7 +670,7 @@ function g.test_custom_type_scalar_variables() end ) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: CustomString!) { test_custom_type_scalar_list( fields: [$field] @@ -711,7 +684,7 @@ function g.test_custom_type_scalar_variables() 'Could not coerce value "inputObject" ' .. 'to type "CustomString"', function() - check_request([[ + helpers.check_request([[ query { test_custom_type_scalar_list( fields: [{a: "2"}] @@ -726,7 +699,7 @@ function g.test_custom_type_scalar_variables() 'the variable type "NonNull(String)" is not compatible with the argument type '.. '"NonNull(CustomString)"', function() - check_request([[ + helpers.check_request([[ query($field: String!) { test_custom_type_scalar_list( fields: [$field] @@ -736,7 +709,7 @@ function g.test_custom_type_scalar_variables() end ) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($fields: [CustomString!]!) { test_custom_type_scalar_list( fields: $fields @@ -751,7 +724,7 @@ function g.test_custom_type_scalar_variables() 'the variable type "NonNull(List(NonNull(String)))" is not compatible with the argument type '.. '"NonNull(List(NonNull(CustomString)))"', function() - check_request([[ + helpers.check_request([[ query($fields: [String!]!) { test_custom_type_scalar_list( fields: $fields @@ -766,7 +739,7 @@ function g.test_custom_type_scalar_variables() 'the variable type "List(NonNull(String))" is not compatible with the argument type '.. '"NonNull(List(NonNull(CustomString)))"', function() - check_request([[ + helpers.check_request([[ query($fields: [String!]) { test_custom_type_scalar_list( fields: $fields @@ -776,7 +749,7 @@ function g.test_custom_type_scalar_variables() end ) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: CustomString!) { test_custom_type_scalar_inputObject( object: { nested_object: { field: $field } } @@ -791,7 +764,7 @@ function g.test_custom_type_scalar_variables() 'the variable type "NonNull(String)" is not compatible with the argument type '.. '"CustomString"', function() - check_request([[ + helpers.check_request([[ query($field: String!) { test_custom_type_scalar_inputObject( object: { nested_object: { field: $field } } @@ -801,7 +774,7 @@ function g.test_custom_type_scalar_variables() end ) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($nested_object: ComplexJsonNestedInputObject!) { test_json_type_inputObject( object: { nested_object: $nested_object } @@ -864,7 +837,7 @@ function g.test_output_type_mismatch_error() t.assert_error_msg_equals( 'Expected "expected_nonnull_list" to be an "array", got "boolean"', function() - check_request([[ + helpers.check_request([[ query { expected_nonnull_list } @@ -875,7 +848,7 @@ function g.test_output_type_mismatch_error() t.assert_error_msg_equals( 'Expected "expected_obj" to be a "map", got "boolean"', function() - check_request([[ + helpers.check_request([[ query { expected_obj { value } } @@ -886,7 +859,7 @@ function g.test_output_type_mismatch_error() t.assert_error_msg_equals( 'Expected "expected_list" to be an "array", got "boolean"', function() - check_request([[ + helpers.check_request([[ query { expected_list } @@ -897,7 +870,7 @@ function g.test_output_type_mismatch_error() t.assert_error_msg_equals( 'Expected "expected_list_with_nested" to be an "array", got "map"', function() - check_request([[ + helpers.check_request([[ query { expected_list_with_nested { values { value } } } @@ -1015,7 +988,7 @@ function g.test_default_values() }, } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: String = "default_value") { test_default_value(arg: $arg) } @@ -1023,7 +996,7 @@ function g.test_default_values() variables = {}, }), {test_default_value = 'default_value'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: String = "default_value") { test_default_value(arg: $arg) } @@ -1031,7 +1004,7 @@ function g.test_default_values() variables = {arg = box.NULL}, }), {test_default_value = 'nil'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: [String] = ["default_value"]) { test_default_list(arg: $arg) } @@ -1039,7 +1012,7 @@ function g.test_default_values() variables = {}, }), {test_default_list = 'default_value'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: [String] = ["default_value"]) { test_default_list(arg: $arg) } @@ -1047,7 +1020,7 @@ function g.test_default_values() variables = {arg = box.NULL}, }), {test_default_list = 'nil'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: default_input_object = {field: "default_value"}) { test_default_object(arg: $arg) } @@ -1055,7 +1028,7 @@ function g.test_default_values() variables = {}, }), {test_default_object = 'default_value'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: default_input_object = {field: "default_value"}) { test_default_object(arg: $arg) } @@ -1063,7 +1036,7 @@ function g.test_default_values() variables = {arg = box.NULL}, }), {test_default_object = 'nil'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($field: Json = "{\"test\": 123}") { test_json_type( field: $field @@ -1073,7 +1046,7 @@ function g.test_default_values() variables = {}, }), {test_json_type = '{"test":123}'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: String = null, $is_null: Boolean) { test_null(arg: $arg is_null: $is_null) } @@ -1081,7 +1054,7 @@ function g.test_default_values() variables = {arg = 'abc'}, }), {test_null = 'abc'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: String = null, $is_null: Boolean) { test_null(arg: $arg is_null: $is_null) } @@ -1089,7 +1062,7 @@ function g.test_default_values() variables = {arg = box.NULL, is_null = true}, }), {test_null = 'is_null'}) - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query($arg: String = null, $is_null: Boolean) { test_null(arg: $arg is_null: $is_null) } @@ -1126,7 +1099,7 @@ function g.test_null() }, } - t.assert_equals(check_request([[ + t.assert_equals(helpers.check_request([[ query { test_null_nullable(arg: null) } @@ -1137,7 +1110,7 @@ function g.test_null() t.assert_error_msg_equals( 'Expected non-null for "NonNull(String)", got null', function() - check_request([[ + helpers.check_request([[ query { test_null_non_nullable(arg: null) } @@ -1169,7 +1142,7 @@ function g.test_validation_non_null_argument_error() t.assert_error_msg_contains( 'Expected non-null', function() - check_request([[ + helpers.check_request([[ query QueryFail { TestEntity(insert: {}) } @@ -1180,7 +1153,7 @@ function g.test_validation_non_null_argument_error() t.assert_error_msg_contains( 'Expected non-null', function() - check_request([[ + helpers.check_request([[ query QueryFail { TestEntity(insert: {non_null: null}) } @@ -1211,7 +1184,7 @@ function g.test_both_data_and_error_result() resolve = callback, } } - local data, errors = check_request(query, query_schema) + local data, errors = helpers.check_request(query, query_schema) t.assert_equals(data, {test_A = 'A', test_B = 'B'}) t.assert_equals(errors, { {message = 'Simple error A'}, @@ -1255,7 +1228,7 @@ function g.test_both_data_and_error_result() } } - data, errors = check_request(query, query_schema) + data, errors = helpers.check_request(query, query_schema) t.assert_equals(data, {prefix = {test_A = 'A', test_B = 'B'}}) t.assert_equals(errors, { {message = "Simple error from internal resolver A"}, @@ -1321,7 +1294,7 @@ function g.test_introspection() }) } - local data, errors = check_request(introspection.query, query_schema, mutation_schema, directives) + local data, errors = helpers.check_request(introspection.query, query_schema, mutation_schema, directives) t.assert_type(data, 'table') t.assert_equals(errors, nil) end @@ -1389,7 +1362,7 @@ function g.test_custom_directives() test_A: test(arg: "A")@custom(arg: "a") } }]] - local data, errors = check_request(simple_query, query_schema, nil, directives) + local data, errors = helpers.check_request(simple_query, query_schema, nil, directives) t.assert_equals(data, { prefix = { test_A = '{"custom":{"arg":"a"}}' }}) t.assert_equals(errors, nil) @@ -1398,7 +1371,7 @@ function g.test_custom_directives() test_B: test(arg: "B")@custom(arg: $arg) } }]] - data, errors = check_request(var_query, query_schema, nil, directives, + data, errors = helpers.check_request(var_query, query_schema, nil, directives, {variables = {arg = 'echo'}}) t.assert_equals(data, { prefix = { test_B = '{"custom":{"arg":"echo"}}' }}) t.assert_equals(errors, nil) @@ -1410,7 +1383,7 @@ function g.test_custom_directives() num = types.int, str = types.string, }, - schema = test_schema_name, -- add type to schema registry so it may be called by name + schema = helpers.test_schema_name, -- add type to schema registry so it may be called by name }) local function callback(_, args, info) @@ -1453,7 +1426,7 @@ function g.test_custom_directives() test_E: test(arg: { num: 2, str: "s" })@override(arg: { str: "s1" }) test_F: test(arg: { num: 2, str: "s" })@override(arg: { }) }]] - data, errors = check_request(query, query_schema, nil, directives) + data, errors = helpers.check_request(query, query_schema, nil, directives) t.assert_equals(data, { test_C = '{"num":3,"str":"s1"}', test_D = '{"num":3,"str":"s"}', @@ -1477,7 +1450,7 @@ function g.test_custom_directives() test_G: test(arg: { num: 2, str: "s" })@override_v2(arg: { num: 5, str: "news" }) }]] - data, errors = check_request(query, query_schema, nil, directives) + data, errors = helpers.check_request(query, query_schema, nil, directives) t.assert_equals(data, { test_G = '{"num":5,"str":"news"}' }) t.assert_equals(errors, nil) @@ -1488,7 +1461,7 @@ function g.test_custom_directives() test_G: test(arg: { num: 2, str: "s" })@override_v2(arg: { num: $num, str: $str }) }]] - data, errors = check_request(query, query_schema, nil, directives, {variables = variables}) + data, errors = helpers.check_request(query, query_schema, nil, directives, {variables = variables}) t.assert_equals(data, { test_G = '{"num":33,"str":"variable"}' }) t.assert_equals(errors, nil) end @@ -1524,7 +1497,7 @@ function g.test_specifiedByURL_scalar_field() } } - local data, errors = check_request(introspection.query, query_schema) + local data, errors = helpers.check_request(introspection.query, query_schema) local CustomInt_schema = util.find_by_name(data.__schema.types, 'CustomInt') t.assert_type(CustomInt_schema, 'table', 'CustomInt schema found on introspection') t.assert_equals(CustomInt_schema.specifiedByURL, 'http://localhost') @@ -1571,7 +1544,7 @@ function g.test_specifiedBy_directive() test_A: test(arg: 1)@specifiedBy(url: "http://localhost") }]] - local data, errors = check_request(query, query_schema) + local data, errors = helpers.check_request(query, query_schema) t.assert_equals(data, { test_A = { url = "http://localhost", value = "1" } }) t.assert_equals(errors, nil) end @@ -1631,7 +1604,7 @@ function g.test_descriptions() } } - local data, errors = check_request(introspection.query, query_schema, mutation_schema) + local data, errors = helpers.check_request(introspection.query, query_schema, mutation_schema) t.assert_equals(errors, nil) local test_query = util.find_by_name(data.__schema.types, 'Query') @@ -1676,7 +1649,7 @@ function g.test_schema_input_arg_described_with_kind() { test(arg: "A") } ]] - local _, errors = check_request(query, query_schema, {}) + local _, errors = helpers.check_request(query, query_schema, {}) t.assert_equals(errors, nil) end @@ -1702,7 +1675,7 @@ function g.test_schema_input_arg_described_with_kind_variable_pass() ]] local variables = { arg = 'B' } - local _, errors = check_request(query, query_schema, nil, nil, { variables = variables }) + local _, errors = helpers.check_request(query, query_schema, nil, nil, { variables = variables }) t.assert_equals(errors, nil) end @@ -1748,7 +1721,7 @@ function g.test_arguments_default_values() } } - local data, errors = check_request(introspection.query, nil, mutation_schema) + local data, errors = helpers.check_request(introspection.query, nil, mutation_schema) t.assert_equals(errors, nil) local mutations = util.find_by_name(data.__schema.types, 'Mutation') @@ -1775,7 +1748,7 @@ function g.test_specifiedByURL_long_scalar() } } - local data, errors = check_request(introspection.query, query_schema) + local data, errors = helpers.check_request(introspection.query, query_schema) local long_type_schema = util.find_by_name(data.__schema.types, 'Long') t.assert_type(long_type_schema, 'table', 'Long scalar type found on introspection') t.assert_equals(long_type_schema.specifiedByURL, 'https://github.com/tarantool/graphql/wiki/Long') @@ -1811,12 +1784,12 @@ function g.test_skip_include_directives() } -- check request without directives - local data, errors = check_request('{test{uri uris{uri}}}', query_schema) + local data, errors = helpers.check_request('{test{uri uris{uri}}}', query_schema) t.assert_equals(errors, nil) t.assert_items_equals(data, {test = {uri = "uri1", uris = {uri = "uri2"}}}) -- check request with directive: skip if == false - data, errors = check_request( + data, errors = helpers.check_request( 'query TEST($skip_field: Boolean){test{uri@skip(if: $skip_field) uris{uri}}}', query_schema, nil, @@ -1827,7 +1800,7 @@ function g.test_skip_include_directives() t.assert_items_equals(data, {test = {uri = "uri1", uris = {uri = "uri2"}}}) -- check request with directive: skip if == true - data, errors = check_request( + data, errors = helpers.check_request( 'query TEST($skip_field: Boolean){test{uri@skip(if: $skip_field) uris{uri}}}', query_schema, nil, @@ -1838,7 +1811,7 @@ function g.test_skip_include_directives() t.assert_items_equals(data, {test = {uris = {uri = "uri2"}}}) -- check request with directive: include if == false - data, errors = check_request( + data, errors = helpers.check_request( 'query TEST($include_field: Boolean){test{uri@include(if: $include_field) uris{uri}}}', query_schema, nil, @@ -1849,7 +1822,7 @@ function g.test_skip_include_directives() t.assert_items_equals(data, {test = {uris = {uri = "uri2"}}}) -- check request with directive: include if == true - data, errors = check_request( + data, errors = helpers.check_request( 'query TEST($include_field: Boolean){test{uri@include(if: $include_field) uris{uri}}}', query_schema, nil, @@ -1920,7 +1893,7 @@ function g.test_mutation_and_directive_arguments_default_values() directives = directives, } - local compiled_schema = schema.create(root, test_schema_name) + local compiled_schema = schema.create(root, helpers.test_schema_name) -- test that schema.typeMap is not corrupted when both mutation and -- directive default values used on the same argument type @@ -2070,7 +2043,7 @@ g.test_propagate_defaults_to_callback = function() }, } - local data, errors = check_request( + local data, errors = helpers.check_request( query, mutation_schema, nil, @@ -2096,7 +2069,7 @@ g.test_propagate_defaults_to_callback = function() } } - data, errors = check_request( + data, errors = helpers.check_request( query, mutation_schema_with_prefix, nil, @@ -2129,7 +2102,7 @@ function g.test_cdata_number_as_float() -- 2^64-1 local variables = {x = 18446744073709551615ULL} - local res = check_request(query, query_schema, nil, nil, {variables = variables}) + local res = helpers.check_request(query, query_schema, nil, nil, {variables = variables}) t.assert_type(res, 'table') t.assert_almost_equals(res.test, 18446744073709551615) end @@ -2163,7 +2136,7 @@ function g.test_large_float_argument() } } - local res = check_request(query, query_schema) + local res = helpers.check_request(query, query_schema) t.assert_type(res, 'table') t.assert_almost_equals(res.test, 18446744073709551615) end @@ -2198,7 +2171,7 @@ function g.test_non_finite_float() for _, x in pairs({nan, inf, ninf}) do local variables = {x = x} t.assert_error_msg_content_equals( - 'Wrong variable "x" for the Scalar "Float"', check_request, query, + 'Wrong variable "x" for the Scalar "Float"', helpers.check_request, query, query_schema, nil, nil, {variables = variables}) end end @@ -2230,7 +2203,7 @@ function g.test_huge_cdata_number() for _, v in ipairs(test_values) do local variables = {x = v[1]} - local res = check_request(query, query_schema, nil, nil, {variables = variables}) + local res = helpers.check_request(query, query_schema, nil, nil, {variables = variables}) t.assert_type(res, 'table') t.assert_equals(res.test, v[1]) t.assert_equals(json.encode(res), v[2]) @@ -2264,7 +2237,7 @@ function g.test_gapped_arrays_output() for _, v in ipairs(test_values) do local variables = {x = v} - local res = check_request(query, query_schema, nil, nil, {variables = variables}) + local res = helpers.check_request(query, query_schema, nil, nil, {variables = variables}) t.assert_type(res, 'table') t.assert_equals(res.test, v) end