-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
with-apollo & with-apollo-auth #8691
Comments
Hey @rheaditi, you can check old examples in the GitHub history. We changed this example to reflect our prioritization of automatic prerendering. People were blindly copying this example without knowing of its downsides. This reflected that all pages were not automatically exported and |
Thanks for the response @huv1k! Completely understand. Tried the older example & it seems to work. Do you think there's a possible middle ground? Something along the lines of using the same So if one sets a static property on the page, But in order to achieve that we have to add A bit stuck here. 🤔 Will try something out to achieve this.. |
We are right now experimenting with a prerendering option on-page levels. This would allow prerender page even that there In examples, we want to stick to best practices so end users always get cached pages, when need. |
Hi I am experiencing the same issue, but not for the same use case, I want to stick to best practices and use cached pages, but I also need to set some graphql subscription before loading the page. |
@huv1k Just want your opinion on the situation - how do you guys suggest handling this currently:
ps: this is not related to the changing the current examples so let me know if I should ask this elsewhere 😅 |
Hey @rheaditi, yes for questions we have spectrum, so please ask your questions there next time. I will close this issue because it's not how we want to examples looks like. Regarding your questions:
|
@tstenel please create an issue with propper reproduction so we can take a look. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
with-apollo & with-apollo-auth example - request
Hey!
So we're using Next.js with Apollo & are updating our app with the new example in with-apollo[-auth] & want to be able to use it in a
default on + opt-out
way rather thandefault off + opt-in
way.Is your feature request related to a problem? Please describe.
Currently, the examples are all in an opt-in mode - meaning if you need apollo, you will need to wrap your page component with
withApollo
explicitly. Similarly for thewith-apollo-auth
example, the pages add theirgetInitialProps
for each page that needs to do something with user context.Describe the solution you'd like
In our case, a lot more of the pages will need apollo + auth rather than not - eg maybe just 2 pages will not need auth and all other pages will; and almost ALL pages will need apollo. So we're looking for a way to go back to the
_app
wrapping example but we're unable to use the currentwithApollo
implementation with_app
.Describe alternatives you've considered
In order to use the same example with
_app
, we tried changing the returnpageProps
in all places to{ pageProps }
, but we're getting a bunch of errors regarding circular structure in JSON. Looks likeApp
does get passed the sameAppTree
component we're using but could not find any documentation regarding thisAppTree
and slightly stuck here.Any help would be appreciated. Thanks :)
The text was updated successfully, but these errors were encountered: