Skip to content

Commit 20f8734

Browse files
committed
fix indentation
1 parent d6fe83b commit 20f8734

File tree

1 file changed

+154
-154
lines changed

1 file changed

+154
-154
lines changed

src/execution/__tests__/variables-test.ts

Lines changed: 154 additions & 154 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,189 +1144,189 @@ describe('Execute: Handles inputs', () => {
11441144
},
11451145
});
11461146
});
1147-
});
11481147

1149-
it('errors with OneOf Input Object with more than one field', () => {
1150-
const result = executeQuery(`
1151-
{
1152-
fieldWithOneOfObjectInput(input: { a: "abc", b: 123 })
1153-
}
1154-
`);
1155-
1156-
expectJSON(result).toDeepEqual({
1157-
data: {
1158-
fieldWithOneOfObjectInput: null,
1159-
},
1160-
errors: [
1148+
it('errors with OneOf Input Object with more than one field', () => {
1149+
const result = executeQuery(`
11611150
{
1162-
message:
1163-
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: "abc", b: 123 }.',
1164-
path: ['fieldWithOneOfObjectInput'],
1165-
locations: [{ line: 3, column: 42 }],
1151+
fieldWithOneOfObjectInput(input: { a: "abc", b: 123 })
1152+
}
1153+
`);
1154+
1155+
expectJSON(result).toDeepEqual({
1156+
data: {
1157+
fieldWithOneOfObjectInput: null,
11661158
},
1167-
],
1159+
errors: [
1160+
{
1161+
message:
1162+
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: "abc", b: 123 }.',
1163+
path: ['fieldWithOneOfObjectInput'],
1164+
locations: [{ line: 3, column: 44 }],
1165+
},
1166+
],
1167+
});
11681168
});
1169-
});
11701169

1171-
it('errors with OneOf Input Object with a single null value', () => {
1172-
const result = executeQuery(`
1173-
{
1174-
fieldWithOneOfObjectInput(input: { a: null })
1175-
}
1176-
`);
1177-
1178-
expectJSON(result).toDeepEqual({
1179-
data: {
1180-
fieldWithOneOfObjectInput: null,
1181-
},
1182-
errors: [
1170+
it('errors with OneOf Input Object with a single null value', () => {
1171+
const result = executeQuery(`
11831172
{
1184-
message:
1185-
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: null }.',
1186-
path: ['fieldWithOneOfObjectInput'],
1187-
locations: [{ line: 3, column: 42 }],
1173+
fieldWithOneOfObjectInput(input: { a: null })
1174+
}
1175+
`);
1176+
1177+
expectJSON(result).toDeepEqual({
1178+
data: {
1179+
fieldWithOneOfObjectInput: null,
11881180
},
1189-
],
1181+
errors: [
1182+
{
1183+
message:
1184+
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: null }.',
1185+
path: ['fieldWithOneOfObjectInput'],
1186+
locations: [{ line: 3, column: 44 }],
1187+
},
1188+
],
1189+
});
11901190
});
1191-
});
11921191

1193-
it('errors with OneOf Input Object with multiple values, only one non-null', () => {
1194-
const result = executeQuery(`
1195-
{
1196-
fieldWithOneOfObjectInput(input: { a: "abc", b: null })
1197-
}
1198-
`);
1199-
1200-
expectJSON(result).toDeepEqual({
1201-
data: {
1202-
fieldWithOneOfObjectInput: null,
1203-
},
1204-
errors: [
1192+
it('errors with OneOf Input Object with multiple values, only one non-null', () => {
1193+
const result = executeQuery(`
12051194
{
1206-
message:
1207-
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: "abc", b: null }.',
1208-
path: ['fieldWithOneOfObjectInput'],
1209-
locations: [{ line: 3, column: 42 }],
1195+
fieldWithOneOfObjectInput(input: { a: "abc", b: null })
1196+
}
1197+
`);
1198+
1199+
expectJSON(result).toDeepEqual({
1200+
data: {
1201+
fieldWithOneOfObjectInput: null,
12101202
},
1211-
],
1203+
errors: [
1204+
{
1205+
message:
1206+
'Argument "input" of type "TestOneOfInputObject" has invalid value { a: "abc", b: null }.',
1207+
path: ['fieldWithOneOfObjectInput'],
1208+
locations: [{ line: 3, column: 44 }],
1209+
},
1210+
],
1211+
});
12121212
});
1213-
});
12141213

1215-
it('allows a variable for the entire OneOf Object with a single value', () => {
1216-
const result = 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+
const result = executeQuery(
1216+
`
1217+
query ($input: TestOneOfInputObject) {
1218+
fieldWithOneOfObjectInput(input: $input)
1219+
}
1220+
`,
1221+
{ input: { a: 'abc' } },
1222+
);
12241223

1225-
expectJSON(result).toDeepEqual({
1226-
data: {
1227-
fieldWithOneOfObjectInput: '{ a: "abc" }',
1228-
},
1224+
expectJSON(result).toDeepEqual({
1225+
data: {
1226+
fieldWithOneOfObjectInput: '{ a: "abc" }',
1227+
},
1228+
});
12291229
});
1230-
});
12311230

1232-
it('allows a variable for the entire OneOf Object with a single defined value', () => {
1233-
const result = 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+
const result = executeQuery(
1233+
`
1234+
query ($input: TestOneOfInputObject) {
1235+
fieldWithOneOfObjectInput(input: $input)
1236+
}
1237+
`,
1238+
{ input: { a: 'abc', b: undefined } },
1239+
);
12411240

1242-
expectJSON(result).toDeepEqual({
1243-
data: {
1244-
fieldWithOneOfObjectInput: '{ a: "abc" }',
1245-
},
1241+
expectJSON(result).toDeepEqual({
1242+
data: {
1243+
fieldWithOneOfObjectInput: '{ a: "abc" }',
1244+
},
1245+
});
12461246
});
1247-
});
12481247

1249-
it('errors with variable with no value', () => {
1250-
const result = executeQuery(
1251-
`
1252-
query ($input: TestOneOfInputObject) {
1253-
fieldWithOneOfObjectInput(input: $input)
1254-
}
1255-
`,
1256-
{ input: {} },
1257-
);
1248+
it('errors with variable with no value', () => {
1249+
const result = executeQuery(
1250+
`
1251+
query ($input: TestOneOfInputObject) {
1252+
fieldWithOneOfObjectInput(input: $input)
1253+
}
1254+
`,
1255+
{ input: {} },
1256+
);
12581257

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+
});
12671267
});
1268-
});
12691268

1270-
it('errors with variable with multiple values', () => {
1271-
const result = 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+
const result = executeQuery(
1271+
`
1272+
query ($input: TestOneOfInputObject) {
1273+
fieldWithOneOfObjectInput(input: $input)
1274+
}
1275+
`,
1276+
{ input: { a: 'abc', b: 123 } },
1277+
);
12791278

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+
});
12881288
});
1289-
});
12901289

1291-
it('errors with variable with single null value', () => {
1292-
const result = 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+
const result = executeQuery(
1292+
`
1293+
query ($input: TestOneOfInputObject) {
1294+
fieldWithOneOfObjectInput(input: $input)
1295+
}
1296+
`,
1297+
{ input: { a: null } },
1298+
);
13001299

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+
});
13091309
});
1310-
});
13111310

1312-
it('errors with variable with multiple values, only one non-null', () => {
1313-
const result = 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+
const result = executeQuery(
1313+
`
1314+
query ($input: TestOneOfInputObject) {
1315+
fieldWithOneOfObjectInput(input: $input)
1316+
}
1317+
`,
1318+
{ input: { a: 'abc', b: null } },
1319+
);
13211320

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.',
1326+
locations: [{ line: 2, column: 18 }],
1327+
},
1328+
],
1329+
});
13301330
});
13311331
});
13321332

0 commit comments

Comments
 (0)