How to implement next-with-apollo with react-apollo SSR?
See original GitHub issueI am using react-apollo
with Next.js
the way it is illustrated in the example from the Next.js repo.
Complete question detail on Spectrum Next.js community.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Server-side rendering - Apollo GraphQL Docs
Server-side rendering (SSR) is a performance optimization for modern web apps. It enables you to render your app's initial state to raw HTML...
Read more >How to implement next-with-apollo with react-apollo SSR?
I want to implement the headers argument from next-with-apollo package like this import withApollo from 'next-with-apollo' import ...
Read more >Server-side rendering (SSR) using Apollo and Next.js - Medium
Apollo: Has that special method called getDataFromTree that finds in your page tree all components that use the hook useQuery. They then execute...
Read more >Configure Apollo Client with Next.js - Hasura
React Apollo Hooks Installation ... Create Apollo Client Instance ... Create a file called apolloClient.js inside the lib folder and write the following ......
Read more >next-with-apollo - npm
Start using next-with-apollo in your project by running `npm i ... Now your page can use anything from @apollo/react-hooks or react-apollo .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@KumarAbhirup I don’t really know why but here are some solutions:
cookie
is set with the proper domain, so the browser is not excluding it, for this case you can for example let the Next.js app set and handle the cookie, instead of your backend, you can see this file to get an idea of how it works.Authorization
header, if you can’t get the cookie then it’s likely that either the browser is not sending it to you, or it’s not set, you can always use devTools in the browser to see the cookies.Always remember that
headers
are only present in the first render of your site (in SSR), thenheaders
will always be undefined and you should use eitherdocument.cookie
or thecredentials
option for fetch operations.I’m going to close this issue for now because it’s not related to this package, I hope you solve it 🙏
I am using
@apollo/react-hooks
. Just wondering, ifnext-with-apollo
supports it.