-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix executing standby queries in ssr #9382
base: main
Are you sure you want to change the base?
Conversation
@atarek12: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
c545a57
to
db57b90
Compare
db57b90
to
278bc0b
Compare
I have added tests for this case |
8ee2964
to
7433b2e
Compare
is this merge request still being looked at? |
The current workaround is to set |
d4583df
to
c7a29b1
Compare
I have reverted the |
0961593
to
4bd8d76
Compare
4bd8d76
to
7393757
Compare
|
7393757
to
546f630
Compare
@jpvajda any updates related to this PR? |
Thanks for this PR, it helped a lot in understanding why the So, instead I've applied the following patch (using diff --git a/react/ssr/ssr.cjs b/react/ssr/ssr.cjs
index 1241a6767609da0d1ef224b8f9f2ef2cec35147c..ace8f0adcb5dabfd982cef09507119a79d4edf5b 100644
--- a/react/ssr/ssr.cjs
+++ b/react/ssr/ssr.cjs
@@ -61,6 +61,7 @@ var RenderPromises = (function () {
return finish ? finish() : null;
};
RenderPromises.prototype.addObservableQueryPromise = function (obsQuery) {
+ if (obsQuery.options.fetchPolicy == 'standby') return null
return this.addQueryPromise({
getOptions: function () { return obsQuery.options; },
fetchData: function () { return new Promise(function (resolve) { Make sure to patch the right file ( |
Also, semantically speaking I don't think that force skipping SSR for Currently, the workaround is to treat any query with So, all in all this is a really nasty bug and I don't think a simple fix would work here because the issue runs deeper. Although maybe @benjamn could shed some light on a possible solution since it's related to SSR 🙏 |
@jerelmiller @bignimbus - This PR might be relevant to some of the work we are doing to offer better SSR support, could you both take a look when you have a free moment? |
close #9336
close #9108
I tried this and all is working as expected. The issue was the promise is not resolved and keep loading forever whenever the fetch policy was
standby
.