Skip to content

Commit d5ba504

Browse files
refactor(validate): use different kinds of types in root-type-test
1 parent c301c68 commit d5ba504

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/type/__tests__/validation-test.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,10 @@ describe('Type System: A Schema must have Object root types', () => {
341341
input SomeInputObject {
342342
test: String
343343
}
344-
input SomeInputObject2 {
345-
test: String
346-
}
347-
input SomeInputObject3 {
348-
test: String
344+
scalar SomeScalar
345+
enum SomeEnum {
346+
ENUM_VALUE_1
347+
ENUM_VALUE_2
349348
}
350349
`);
351350

@@ -362,7 +361,7 @@ describe('Type System: A Schema must have Object root types', () => {
362361
schema,
363362
parse(`
364363
extend schema {
365-
mutation: SomeInputObject2
364+
mutation: SomeScalar
366365
}
367366
`),
368367
);
@@ -371,7 +370,7 @@ describe('Type System: A Schema must have Object root types', () => {
371370
schema,
372371
parse(`
373372
extend schema {
374-
subscription: SomeInputObject3
373+
subscription: SomeEnum
375374
}
376375
`),
377376
);
@@ -384,12 +383,12 @@ describe('Type System: A Schema must have Object root types', () => {
384383
},
385384
{
386385
message:
387-
'Mutation root type must be Object type if provided, it cannot be SomeInputObject2.',
386+
'Mutation root type must be Object type if provided, it cannot be SomeScalar.',
388387
locations: [{ line: 3, column: 21 }],
389388
},
390389
{
391390
message:
392-
'Subscription root type must be Object type if provided, it cannot be SomeInputObject3.',
391+
'Subscription root type must be Object type if provided, it cannot be SomeEnum.',
393392
locations: [{ line: 3, column: 25 }],
394393
},
395394
]);

0 commit comments

Comments
 (0)