diff --git a/validator/imported/graphql-js-commit.log b/validator/imported/graphql-js-commit.log index 58d20686..ae97536e 100644 --- a/validator/imported/graphql-js-commit.log +++ b/validator/imported/graphql-js-commit.log @@ -1 +1 @@ -48afd37a48d37f6d3342b959e8cb34e1ecbfeffb +e2457b33e928f4ec8b22e96a6dc6cb2808c03dfa diff --git a/validator/imported/spec/ValuesOfCorrectTypeRule.spec.yml b/validator/imported/spec/ValuesOfCorrectTypeRule.spec.yml index 194f5824..0d3ef799 100644 --- a/validator/imported/spec/ValuesOfCorrectTypeRule.spec.yml +++ b/validator/imported/spec/ValuesOfCorrectTypeRule.spec.yml @@ -1015,21 +1015,6 @@ - message: Field "OneOfInput.stringField" must be non-null. locations: - {line: 4, column: 37} -- name: Invalid oneOf input object value/Exactly one nullable variable - rule: ValuesOfCorrectType - schema: 0 - query: |2- - - query ($string: String) { - complicatedArgs { - oneOfArgField(oneOfArg: { stringField: $string }) - } - } - - errors: - - message: Variable "string" must be non-nullable to be used for OneOf Input Object "OneOfInput". - locations: - - {line: 4, column: 37} - name: Invalid oneOf input object value/More than one field rule: ValuesOfCorrectType schema: 0 diff --git a/validator/imported/spec/VariablesInAllowedPositionRule.spec.yml b/validator/imported/spec/VariablesInAllowedPositionRule.spec.yml index e21f0e74..b58ceccc 100644 --- a/validator/imported/spec/VariablesInAllowedPositionRule.spec.yml +++ b/validator/imported/spec/VariablesInAllowedPositionRule.spec.yml @@ -346,3 +346,43 @@ dog @include(if: $boolVar) } errors: [] +- name: Allows exactly one non-nullable variable + rule: VariablesInAllowedPosition + schema: 0 + query: |2- + + query ($string: String!) { + complicatedArgs { + oneOfArgField(oneOfArg: { stringField: $string }) + } + } + + errors: [] +- name: Undefined variable in oneOf input object + rule: VariablesInAllowedPosition + schema: 0 + query: |2- + + { + complicatedArgs { + oneOfArgField(oneOfArg: { stringField: $undefinedVariable }) + } + } + + errors: [] +- name: Forbids one nullable variable + rule: VariablesInAllowedPosition + schema: 0 + query: |2- + + query ($string: String) { + complicatedArgs { + oneOfArgField(oneOfArg: { stringField: $string }) + } + } + + errors: + - message: Variable "$string" is of type "String" but must be non-nullable to be used for OneOf Input Object "OneOfInput". + locations: + - {line: 2, column: 14} + - {line: 4, column: 50}