Skip to content

validation-test: Test root type validation with multiple types #3567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/type/__tests__/validation-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ describe('Type System: A Schema must have Object root types', () => {
input SomeInputObject {
test: String
}
scalar SomeScalar
enum SomeEnum {
ENUM_VALUE
}
`);

schema = extendSchema(
Expand All @@ -356,7 +362,7 @@ describe('Type System: A Schema must have Object root types', () => {
schema,
parse(`
extend schema {
mutation: SomeInputObject
mutation: SomeScalar
}
`),
);
Expand All @@ -365,7 +371,7 @@ describe('Type System: A Schema must have Object root types', () => {
schema,
parse(`
extend schema {
subscription: SomeInputObject
subscription: SomeEnum
}
`),
);
Expand All @@ -378,12 +384,12 @@ describe('Type System: A Schema must have Object root types', () => {
},
{
message:
'Mutation root type must be Object type if provided, it cannot be SomeInputObject.',
'Mutation root type must be Object type if provided, it cannot be SomeScalar.',
locations: [{ line: 3, column: 21 }],
},
{
message:
'Subscription root type must be Object type if provided, it cannot be SomeInputObject.',
'Subscription root type must be Object type if provided, it cannot be SomeEnum.',
locations: [{ line: 3, column: 25 }],
},
]);
Expand Down