@@ -142,6 +142,21 @@ func TestValidate_ArgValuesOfCorrectType_InvalidStringValues_UnquotedStringIntoS
142
142
})
143
143
}
144
144
145
+ func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_StringIntoInt (t * testing.T ) {
146
+ testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
147
+ {
148
+ complicatedArgs {
149
+ intArgField(intArg: "3")
150
+ }
151
+ }
152
+ ` ,
153
+ []gqlerrors.FormattedError {
154
+ testutil .RuleError (
155
+ `Argument "intArg" expected type "Int" but got: "3".` ,
156
+ 4 , 33 ,
157
+ ),
158
+ })
159
+ }
145
160
func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_BigIntIntoInt (t * testing.T ) {
146
161
testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
147
162
{
@@ -203,6 +218,52 @@ func TestValidate_ArgValuesOfCorrectType_InvalidIntValues_FloatIntoInt(t *testin
203
218
})
204
219
}
205
220
221
+ func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_StringIntoFloat (t * testing.T ) {
222
+ testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
223
+ {
224
+ complicatedArgs {
225
+ floatArgField(floatArg: "3.333")
226
+ }
227
+ }
228
+ ` ,
229
+ []gqlerrors.FormattedError {
230
+ testutil .RuleError (
231
+ `Argument "floatArg" expected type "Float" but got: "3.333".` ,
232
+ 4 , 37 ,
233
+ ),
234
+ })
235
+ }
236
+ func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_BooleanIntoFloat (t * testing.T ) {
237
+ testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
238
+ {
239
+ complicatedArgs {
240
+ floatArgField(floatArg: true)
241
+ }
242
+ }
243
+ ` ,
244
+ []gqlerrors.FormattedError {
245
+ testutil .RuleError (
246
+ `Argument "floatArg" expected type "Float" but got: true.` ,
247
+ 4 , 37 ,
248
+ ),
249
+ })
250
+ }
251
+ func TestValidate_ArgValuesOfCorrectType_InvalidFloatValues_UnquotedIntoFloat (t * testing.T ) {
252
+ testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
253
+ {
254
+ complicatedArgs {
255
+ floatArgField(floatArg: FOO)
256
+ }
257
+ }
258
+ ` ,
259
+ []gqlerrors.FormattedError {
260
+ testutil .RuleError (
261
+ `Argument "floatArg" expected type "Float" but got: FOO.` ,
262
+ 4 , 37 ,
263
+ ),
264
+ })
265
+ }
266
+
206
267
func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_IntIntoBoolean (t * testing.T ) {
207
268
testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
208
269
{
@@ -264,7 +325,7 @@ func TestValidate_ArgValuesOfCorrectType_InvalidBooleanValues_UnquotedStringInto
264
325
})
265
326
}
266
327
267
- func TestValidate_ArgValuesOfCorrectType_InvalidIDValues_FloatIntoID (t * testing.T ) {
328
+ func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_FloatIntoID (t * testing.T ) {
268
329
testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
269
330
{
270
331
complicatedArgs {
@@ -279,7 +340,7 @@ func TestValidate_ArgValuesOfCorrectType_InvalidIDValues_FloatIntoID(t *testing.
279
340
),
280
341
})
281
342
}
282
- func TestValidate_ArgValuesOfCorrectType_InvalidIDValues_BooleanIntoID (t * testing.T ) {
343
+ func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_BooleanIntoID (t * testing.T ) {
283
344
testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
284
345
{
285
346
complicatedArgs {
@@ -294,7 +355,7 @@ func TestValidate_ArgValuesOfCorrectType_InvalidIDValues_BooleanIntoID(t *testin
294
355
),
295
356
})
296
357
}
297
- func TestValidate_ArgValuesOfCorrectType_InvalidIDValues_UnquotedIntoID (t * testing.T ) {
358
+ func TestValidate_ArgValuesOfCorrectType_InvalidIDValue_UnquotedIntoID (t * testing.T ) {
298
359
testutil .ExpectFailsRule (t , graphql .ArgumentsOfCorrectTypeRule , `
299
360
{
300
361
complicatedArgs {
0 commit comments