Skip to content

Commit 25b5c21

Browse files
Initial import
Signed-off-by: Steve Coffman <steve@khanacademy.org>
1 parent bc8eaec commit 25b5c21

3 files changed

Lines changed: 41 additions & 16 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
48afd37a48d37f6d3342b959e8cb34e1ecbfeffb
1+
e2457b33e928f4ec8b22e96a6dc6cb2808c03dfa

validator/imported/spec/ValuesOfCorrectTypeRule.spec.yml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,21 +1015,6 @@
10151015
- message: Field "OneOfInput.stringField" must be non-null.
10161016
locations:
10171017
- {line: 4, column: 37}
1018-
- name: Invalid oneOf input object value/Exactly one nullable variable
1019-
rule: ValuesOfCorrectType
1020-
schema: 0
1021-
query: |2-
1022-
1023-
query ($string: String) {
1024-
complicatedArgs {
1025-
oneOfArgField(oneOfArg: { stringField: $string })
1026-
}
1027-
}
1028-
1029-
errors:
1030-
- message: Variable "string" must be non-nullable to be used for OneOf Input Object "OneOfInput".
1031-
locations:
1032-
- {line: 4, column: 37}
10331018
- name: Invalid oneOf input object value/More than one field
10341019
rule: ValuesOfCorrectType
10351020
schema: 0

validator/imported/spec/VariablesInAllowedPositionRule.spec.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,3 +346,43 @@
346346
dog @include(if: $boolVar)
347347
}
348348
errors: []
349+
- name: Allows exactly one non-nullable variable
350+
rule: VariablesInAllowedPosition
351+
schema: 0
352+
query: |2-
353+
354+
query ($string: String!) {
355+
complicatedArgs {
356+
oneOfArgField(oneOfArg: { stringField: $string })
357+
}
358+
}
359+
360+
errors: []
361+
- name: Undefined variable in oneOf input object
362+
rule: VariablesInAllowedPosition
363+
schema: 0
364+
query: |2-
365+
366+
{
367+
complicatedArgs {
368+
oneOfArgField(oneOfArg: { stringField: $undefinedVariable })
369+
}
370+
}
371+
372+
errors: []
373+
- name: Forbids one nullable variable
374+
rule: VariablesInAllowedPosition
375+
schema: 0
376+
query: |2-
377+
378+
query ($string: String) {
379+
complicatedArgs {
380+
oneOfArgField(oneOfArg: { stringField: $string })
381+
}
382+
}
383+
384+
errors:
385+
- message: Variable "$string" is of type "String" but must be non-nullable to be used for OneOf Input Object "OneOfInput".
386+
locations:
387+
- {line: 2, column: 14}
388+
- {line: 4, column: 50}

0 commit comments

Comments
 (0)