You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: "abc", b: null }.',
1207
+
path: ['fieldWithOneOfObjectInput'],
1208
+
locations: [{line: 3,column: 44}],
1209
+
},
1210
+
],
1211
+
});
1212
1212
});
1213
-
});
1214
1213
1215
-
it('allows a variable for the entire OneOf Object with a single value',()=>{
1216
-
constresult=executeQuery(
1217
-
`
1218
-
query ($input: TestOneOfInputObject) {
1219
-
fieldWithOneOfObjectInput(input: $input)
1220
-
}
1221
-
`,
1222
-
{input: {a: 'abc'}},
1223
-
);
1214
+
it('allows a variable for the entire OneOf Object with a single value',()=>{
1215
+
constresult=executeQuery(
1216
+
`
1217
+
query ($input: TestOneOfInputObject) {
1218
+
fieldWithOneOfObjectInput(input: $input)
1219
+
}
1220
+
`,
1221
+
{input: {a: 'abc'}},
1222
+
);
1224
1223
1225
-
expectJSON(result).toDeepEqual({
1226
-
data: {
1227
-
fieldWithOneOfObjectInput: '{ a: "abc" }',
1228
-
},
1224
+
expectJSON(result).toDeepEqual({
1225
+
data: {
1226
+
fieldWithOneOfObjectInput: '{ a: "abc" }',
1227
+
},
1228
+
});
1229
1229
});
1230
-
});
1231
1230
1232
-
it('allows a variable for the entire OneOf Object with a single defined value',()=>{
1233
-
constresult=executeQuery(
1234
-
`
1235
-
query ($input: TestOneOfInputObject) {
1236
-
fieldWithOneOfObjectInput(input: $input)
1237
-
}
1238
-
`,
1239
-
{input: {a: 'abc',b: undefined}},
1240
-
);
1231
+
it('allows a variable for the entire OneOf Object with a single defined value',()=>{
1232
+
constresult=executeQuery(
1233
+
`
1234
+
query ($input: TestOneOfInputObject) {
1235
+
fieldWithOneOfObjectInput(input: $input)
1236
+
}
1237
+
`,
1238
+
{input: {a: 'abc',b: undefined}},
1239
+
);
1241
1240
1242
-
expectJSON(result).toDeepEqual({
1243
-
data: {
1244
-
fieldWithOneOfObjectInput: '{ a: "abc" }',
1245
-
},
1241
+
expectJSON(result).toDeepEqual({
1242
+
data: {
1243
+
fieldWithOneOfObjectInput: '{ a: "abc" }',
1244
+
},
1245
+
});
1246
1246
});
1247
-
});
1248
1247
1249
-
it('errors with variable with no value',()=>{
1250
-
constresult=executeQuery(
1251
-
`
1252
-
query ($input: TestOneOfInputObject) {
1253
-
fieldWithOneOfObjectInput(input: $input)
1254
-
}
1255
-
`,
1256
-
{input: {}},
1257
-
);
1248
+
it('errors with variable with no value',()=>{
1249
+
constresult=executeQuery(
1250
+
`
1251
+
query ($input: TestOneOfInputObject) {
1252
+
fieldWithOneOfObjectInput(input: $input)
1253
+
}
1254
+
`,
1255
+
{input: {}},
1256
+
);
1258
1257
1259
-
expectJSON(result).toDeepEqual({
1260
-
errors: [
1261
-
{
1262
-
message:
1263
-
'Variable "$input" got invalid value {}; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1264
-
locations: [{line: 2,column: 16}],
1265
-
},
1266
-
],
1258
+
expectJSON(result).toDeepEqual({
1259
+
errors: [
1260
+
{
1261
+
message:
1262
+
'Variable "$input" got invalid value {}; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1263
+
locations: [{line: 2,column: 18}],
1264
+
},
1265
+
],
1266
+
});
1267
1267
});
1268
-
});
1269
1268
1270
-
it('errors with variable with multiple values',()=>{
1271
-
constresult=executeQuery(
1272
-
`
1273
-
query ($input: TestOneOfInputObject) {
1274
-
fieldWithOneOfObjectInput(input: $input)
1275
-
}
1276
-
`,
1277
-
{input: {a: 'abc',b: 123}},
1278
-
);
1269
+
it('errors with variable with multiple values',()=>{
1270
+
constresult=executeQuery(
1271
+
`
1272
+
query ($input: TestOneOfInputObject) {
1273
+
fieldWithOneOfObjectInput(input: $input)
1274
+
}
1275
+
`,
1276
+
{input: {a: 'abc',b: 123}},
1277
+
);
1279
1278
1280
-
expectJSON(result).toDeepEqual({
1281
-
errors: [
1282
-
{
1283
-
message:
1284
-
'Variable "$input" got invalid value { a: "abc", b: 123 }; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1285
-
locations: [{line: 2,column: 16}],
1286
-
},
1287
-
],
1279
+
expectJSON(result).toDeepEqual({
1280
+
errors: [
1281
+
{
1282
+
message:
1283
+
'Variable "$input" got invalid value { a: "abc", b: 123 }; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1284
+
locations: [{line: 2,column: 18}],
1285
+
},
1286
+
],
1287
+
});
1288
1288
});
1289
-
});
1290
1289
1291
-
it('errors with variable with single null value',()=>{
1292
-
constresult=executeQuery(
1293
-
`
1294
-
query ($input: TestOneOfInputObject) {
1295
-
fieldWithOneOfObjectInput(input: $input)
1296
-
}
1297
-
`,
1298
-
{input: {a: null}},
1299
-
);
1290
+
it('errors with variable with single null value',()=>{
1291
+
constresult=executeQuery(
1292
+
`
1293
+
query ($input: TestOneOfInputObject) {
1294
+
fieldWithOneOfObjectInput(input: $input)
1295
+
}
1296
+
`,
1297
+
{input: {a: null}},
1298
+
);
1300
1299
1301
-
expectJSON(result).toDeepEqual({
1302
-
errors: [
1303
-
{
1304
-
message:
1305
-
'Variable "$input" got invalid value null at "input.a"; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1306
-
locations: [{line: 2,column: 16}],
1307
-
},
1308
-
],
1300
+
expectJSON(result).toDeepEqual({
1301
+
errors: [
1302
+
{
1303
+
message:
1304
+
'Variable "$input" got invalid value null at "input.a"; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1305
+
locations: [{line: 2,column: 18}],
1306
+
},
1307
+
],
1308
+
});
1309
1309
});
1310
-
});
1311
1310
1312
-
it('errors with variable with multiple values, only one non-null',()=>{
1313
-
constresult=executeQuery(
1314
-
`
1315
-
query ($input: TestOneOfInputObject) {
1316
-
fieldWithOneOfObjectInput(input: $input)
1317
-
}
1318
-
`,
1319
-
{input: {a: 'abc',b: null}},
1320
-
);
1311
+
it('errors with variable with multiple values, only one non-null',()=>{
1312
+
constresult=executeQuery(
1313
+
`
1314
+
query ($input: TestOneOfInputObject) {
1315
+
fieldWithOneOfObjectInput(input: $input)
1316
+
}
1317
+
`,
1318
+
{input: {a: 'abc',b: null}},
1319
+
);
1321
1320
1322
-
expectJSON(result).toDeepEqual({
1323
-
errors: [
1324
-
{
1325
-
message:
1326
-
'Variable "$input" got invalid value { a: "abc", b: null }; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
1327
-
locations: [{line: 2,column: 16}],
1328
-
},
1329
-
],
1321
+
expectJSON(result).toDeepEqual({
1322
+
errors: [
1323
+
{
1324
+
message:
1325
+
'Variable "$input" got invalid value { a: "abc", b: null }; Within OneOf Input Object type "TestOneOfInputObject", exactly one field must be specified, and the value for that field must be non-null.',
0 commit comments