Skip to content
Discussion options

You must be logged in to vote

Hi @zefexdeveloper this is a very good question. I'll try to give you a very detailed answer 😌

api-routes-apollo-server-and-client is using getStaticProps in pages/index.js to add Static Generation to the page, this is good because the data for the page in this case is known at build time, therefore we can pregenerate the page and serve the same static files to the users using the site.

The page in question seems to be rendering user info, but that example doesn't have authentication, we could probably just update it for a more clear use case.

About _app.js, in both examples, and in all Apollo examples, takes care of starting the global Apollo client that can be used for all pages, it w…

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
11 replies
@lfades
Comment options

lfades Jun 14, 2020
Collaborator

@Albert-Gao
Comment options

@lfades
Comment options

lfades Jun 15, 2020
Collaborator

@sushilbansal
Comment options

@lfades
Comment options

lfades Jul 10, 2020
Collaborator

Answer selected by theprobugmaker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
4 participants