diff --git a/packages/graphql-live-query/src/rules/NoLiveMixedWithDeferStreamRule.ts b/packages/graphql-live-query/src/rules/NoLiveMixedWithDeferStreamRule.ts index 8ab5c8ea..8c0c19de 100644 --- a/packages/graphql-live-query/src/rules/NoLiveMixedWithDeferStreamRule.ts +++ b/packages/graphql-live-query/src/rules/NoLiveMixedWithDeferStreamRule.ts @@ -4,16 +4,21 @@ import { getLiveDirectiveNode } from "../getLiveDirectiveNode.js"; import { isNone } from "../Maybe.js"; export const NoLiveMixedWithDeferStreamRule: ValidationRule = (context) => { + let opmatch = false; return { OperationDefinition(operationDefinitionNode) { if (isNone(getLiveDirectiveNode(operationDefinitionNode))) { return false; + } else { + opmatch = true; } }, Directive(directiveNode) { if ( - directiveNode.name.value === "defer" || - directiveNode.name.value === "stream" + opmatch && ( + directiveNode.name.value === "defer" || + directiveNode.name.value === "stream" + ) ) { context.reportError( new GraphQLError(