Skip to content

Commit b8c1edd

Browse files
committed
Also check if defer is part of the query for no-cache queries
1 parent 21e89eb commit b8c1edd

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/core/QueryInfo.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
getOperationName,
1919
graphQLResultHasError,
2020
handleIncrementalSymbol,
21+
hasDirectives,
2122
streamInfoSymbol,
2223
} from "@apollo/client/utilities/internal";
2324
import { invariant } from "@apollo/client/utilities/invariant";
@@ -293,7 +294,9 @@ export class QueryInfo<
293294
// to see if it fulfills the selection set. For such a narrow case where
294295
// its incorrect on a format that is now outdated is not worth the
295296
// fix so we are ok with reporting a `streaming` here.
296-
(!this.incremental?.pending && this.hasNext)
297+
(!this.incremental?.pending &&
298+
this.hasNext &&
299+
hasDirectives(["defer"], query))
297300
) {
298301
result.dataState = "streaming";
299302
}

0 commit comments

Comments
 (0)