Skip to content

Commit 4fb0d80

Browse files
committed
add test for mixture of default and custom root types
1 parent 1d98a6a commit 4fb0d80

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/utilities/__tests__/buildASTSchema-test.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,22 @@ describe('Schema Builder', () => {
10331033
expect(schema.getSubscriptionType()).to.include({ name: 'Subscription' });
10341034
});
10351035

1036+
it('Mixture of default and custom root operation types', () => {
1037+
const schema = buildSchema(`
1038+
extend schema {
1039+
query: SomeQuery
1040+
}
1041+
type SomeQuery
1042+
type Query
1043+
type Mutation
1044+
type Subscription
1045+
`);
1046+
1047+
expect(schema.getQueryType()).to.include({ name: 'SomeQuery' });
1048+
expect(schema.getMutationType()).to.include({ name: 'Mutation' });
1049+
expect(schema.getSubscriptionType()).to.include({ name: 'Subscription' });
1050+
});
1051+
10361052
it('can build invalid schema', () => {
10371053
// Invalid schema, because it is missing query root type
10381054
const schema = buildSchema('type Mutation');

0 commit comments

Comments
 (0)