Skip to content

Commit 027c056

Browse files
committed
add more tests
1 parent 304cef6 commit 027c056

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/validation/__tests__/KnownOperationTypesRules-test.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('Validate: Known operation types', () => {
1919
`);
2020
});
2121

22-
it('one unknown operation', () => {
22+
it('unknown mutation operation', () => {
2323
expectErrors(`
2424
mutation { field }
2525
`).toDeepEqual([
@@ -30,15 +30,31 @@ describe('Validate: Known operation types', () => {
3030
]);
3131
});
3232

33+
it('unknown subscription operation', () => {
34+
expectErrors(`
35+
subscription { field }
36+
`).toDeepEqual([
37+
{
38+
message: 'The subscription operation is not supported by the schema.',
39+
locations: [{ line: 2, column: 7 }],
40+
},
41+
]);
42+
});
43+
3344
it('mixture of known and unknown operations', () => {
3445
expectErrors(`
3546
query { field }
3647
mutation { field }
48+
subscription { field }
3749
`).toDeepEqual([
3850
{
3951
message: 'The mutation operation is not supported by the schema.',
4052
locations: [{ line: 3, column: 7 }],
4153
},
54+
{
55+
message: 'The subscription operation is not supported by the schema.',
56+
locations: [{ line: 4, column: 7 }],
57+
},
4258
]);
4359
});
4460
});

0 commit comments

Comments
 (0)