Skip to content

Commit 694c73d

Browse files
committed
Add passing test for viral schema parsing
1 parent 7e6d9f7 commit 694c73d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/utilities/__tests__/buildASTSchema-test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { assert, expect } from 'chai';
22
import { describe, it } from 'mocha';
33

44
import { dedent } from '../../__testUtils__/dedent.js';
5+
import { viralSDL } from '../../__testUtils__/viralSDL.js';
56

67
import type { Maybe } from '../../jsutils/Maybe.js';
78

@@ -1092,4 +1093,14 @@ describe('Schema Builder', () => {
10921093
'Unknown type: "UnknownType".',
10931094
);
10941095
});
1096+
1097+
it('correctly processes viral schema', () => {
1098+
const schema = buildSchema(viralSDL);
1099+
expect(schema.getQueryType()).to.contain({ name: 'Query' });
1100+
expect(schema.getType('Virus')).to.contain({ name: 'Virus' });
1101+
expect(schema.getType('Mutation')).to.contain({ name: 'Mutation' });
1102+
// Though the viral schema has a 'Mutation' type, it is not used for the
1103+
// 'mutation' operation.
1104+
expect(schema.getMutationType()).to.equal(undefined);
1105+
});
10951106
});

0 commit comments

Comments
 (0)