Skip to content

Commit

Permalink
tests(printSchema): test omitting schema of common names
Browse files Browse the repository at this point in the history
Extracted from #3362
Co-authored-by: spawnia <benedikt@franke.tech>
  • Loading branch information
IvanGoncharov committed Mar 28, 2022
1 parent def26e6 commit a37478a
Showing 1 changed file with 16 additions and 0 deletions.
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

0 comments on commit a37478a

Please sign in to comment.