diff --git a/src/react/data/QueryData.ts b/src/react/data/QueryData.ts index 2fc8fdf14b2..64374f1d2a5 100644 --- a/src/react/data/QueryData.ts +++ b/src/react/data/QueryData.ts @@ -133,7 +133,9 @@ export class QueryData extends OperationData { this.cleanup(); this.runLazy = true; this.lazyOptions = options; - if (this.isMounted) this.onNewData(); + if (this.isMounted || this.ssrInitiated()) { + this.onNewData(); + } }; private getExecuteResult(): QueryResult { @@ -291,7 +293,9 @@ export class QueryData extends OperationData { return; } - if (this.isMounted) onNewData(); + if (this.isMounted || this.ssrInitiated()) { + onNewData(); + } }, error: error => { this.resubscribeToQuery(); @@ -303,7 +307,9 @@ export class QueryData extends OperationData { !equal(error, this.previousData.error) ) { this.previousData.error = error; - if (this.isMounted) onNewData(); + if (this.isMounted || this.ssrInitiated()) { + onNewData(); + } } } });