We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52cd5a9 commit 3c66b79Copy full SHA for 3c66b79
packages/graphql-live-query/src/rules/NoLiveMixedWithDeferStreamRule.ts
@@ -4,16 +4,21 @@ import { getLiveDirectiveNode } from "../getLiveDirectiveNode.js";
4
import { isNone } from "../Maybe.js";
5
6
export const NoLiveMixedWithDeferStreamRule: ValidationRule = (context) => {
7
+ let opmatch = false;
8
return {
9
OperationDefinition(operationDefinitionNode) {
10
if (isNone(getLiveDirectiveNode(operationDefinitionNode))) {
11
return false;
12
+ } else {
13
+ opmatch = true;
14
}
15
},
16
Directive(directiveNode) {
17
if (
- directiveNode.name.value === "defer" ||
- directiveNode.name.value === "stream"
18
+ opmatch && (
19
+ directiveNode.name.value === "defer" ||
20
+ directiveNode.name.value === "stream"
21
+ )
22
) {
23
context.reportError(
24
new GraphQLError(
0 commit comments