Skip to content
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

tests(printSchema): test omitting schema of common names #3524

Merged
merged 1 commit into from Mar 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/utilities/__tests__/printSchema-test.ts
Expand Up @@ -276,6 +276,22 @@ describe('Type System Printer', () => {
`);
});

it('Omits schema of common names', () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({ name: 'Query', fields: {} }),
mutation: new GraphQLObjectType({ name: 'Mutation', fields: {} }),
subscription: new GraphQLObjectType({ name: 'Subscription', fields: {} }),
});

expectPrintedSchema(schema).to.equal(dedent`
type Query
type Mutation
type Subscription
`);
});

it('Prints custom query root types', () => {
const schema = new GraphQLSchema({
query: new GraphQLObjectType({ name: 'CustomType', fields: {} }),
Expand Down