Skip to content

Commit 80a7f0e

Browse files
committed
validation-test: Test root type validation with multiple types
Extracted from graphql#3453 All credits goes to @thomasheyenbrock
1 parent 839f244 commit 80a7f0e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/type/__tests__/validation-test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,13 @@ describe('Type System: A Schema must have Object root types', () => {
341341
input SomeInputObject {
342342
test: String
343343
}
344+
345+
scalar SomeScalar
346+
347+
enum SomeEnum {
348+
ENUM_VALUE_1
349+
ENUM_VALUE_2
350+
}
344351
`);
345352

346353
schema = extendSchema(
@@ -356,7 +363,7 @@ describe('Type System: A Schema must have Object root types', () => {
356363
schema,
357364
parse(`
358365
extend schema {
359-
mutation: SomeInputObject
366+
mutation: SomeScalar
360367
}
361368
`),
362369
);
@@ -365,7 +372,7 @@ describe('Type System: A Schema must have Object root types', () => {
365372
schema,
366373
parse(`
367374
extend schema {
368-
subscription: SomeInputObject
375+
subscription: SomeEnum
369376
}
370377
`),
371378
);
@@ -378,12 +385,12 @@ describe('Type System: A Schema must have Object root types', () => {
378385
},
379386
{
380387
message:
381-
'Mutation root type must be Object type if provided, it cannot be SomeInputObject.',
388+
'Mutation root type must be Object type if provided, it cannot be SomeScalar.',
382389
locations: [{ line: 3, column: 21 }],
383390
},
384391
{
385392
message:
386-
'Subscription root type must be Object type if provided, it cannot be SomeInputObject.',
393+
'Subscription root type must be Object type if provided, it cannot be SomeEnum.',
387394
locations: [{ line: 3, column: 25 }],
388395
},
389396
]);

0 commit comments

Comments
 (0)