diff --git a/src/__tests__/QueryComplexity-test.ts b/src/__tests__/QueryComplexity-test.ts index 92269dd..1630c22 100644 --- a/src/__tests__/QueryComplexity-test.ts +++ b/src/__tests__/QueryComplexity-test.ts @@ -891,4 +891,25 @@ describe('QueryComplexity analysis', () => { expect(errors).to.have.length(1); expect(errors[0].message).to.contain('INVALIDVALUE'); }); + + it("won't fail on subscription document", () => { + const ast = parse(` + subscription { + foo + } + `); + + const errors = validate(schema, ast, [ + createComplexityRule({ + maximumComplexity: 1000, + estimators: [ + simpleEstimator({ + defaultComplexity: 1, + }), + ], + }), + ]); + + expect(errors).to.have.length(0); + }); });