Skip to content

Commit fbcda23

Browse files
committed
Add nested nullable test in VariablesInAllowedPositions test
1 parent 65fb6ae commit fbcda23

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/validation/__tests__/VariablesInAllowedPosition-test.js

+21
Original file line numberDiff line numberDiff line change
@@ -360,4 +360,25 @@ describe('Validate: Variables are in allowed positions', () => {
360360
],
361361
);
362362
});
363+
364+
it('[String] => [String!]', () => {
365+
expectFailsRule(
366+
VariablesInAllowedPosition,
367+
`
368+
query Query($stringListVar: [String])
369+
{
370+
complicatedArgs {
371+
stringListNonNullArgField(stringListNonNullArg: $stringListVar)
372+
}
373+
}
374+
`,
375+
[
376+
{
377+
message: badVarPosMessage('stringListVar', '[String]', '[String!]'),
378+
locations: [{ line: 2, column: 19 }, { line: 5, column: 59 }],
379+
path: undefined,
380+
},
381+
],
382+
);
383+
});
363384
});

src/validation/__tests__/harness.js

+8
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,14 @@ const ComplicatedArgs = new GraphQLObjectType({
228228
type: GraphQLString,
229229
args: { stringListArg: { type: GraphQLList(GraphQLString) } },
230230
},
231+
stringListNonNullArgField: {
232+
type: GraphQLString,
233+
args: {
234+
stringListNonNullArg: {
235+
type: GraphQLList(GraphQLNonNull(GraphQLString)),
236+
},
237+
},
238+
},
231239
complexArgField: {
232240
type: GraphQLString,
233241
args: { complexArg: { type: ComplexInput } },

0 commit comments

Comments
 (0)