Apollo & Redux example doesn't wait for data during SSR rendering
See original GitHub issueExamples bug report
Describe the bug
Clone the “with-apollo” and example and the “with-apollo-and-redux” example. Compare the source code generated on the server side. In the “with-apollo” the full post list is rendered on the server side, but in the “with-apollo-and-redux” example the GraphQL query is executed client-side and you’ll see Loading
. As for me the, the only purpose of Next.js is to generate the entire HTML on the server side, and this example is only meant to be a mix of the “with-apollo” and “with-redux” examples, I would expect the same behavior like in the “with-apollo” example (HTML including GraphQL rendered server side).
Why isn’t this the case?
Screenshots
System information
- OS: Windows 10
- Browser Firefox 70
- Version of Next.js: 9.0.6
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Server Side Rendering with GraphQL
Server side rendering (SSR) is a technique used to speed up load time of JavaScript applications by pre-rendering HTML on the server, ...
Read more >How I Learnt Server Side Rendering with React, Redux ...
Using Server side rendering with Apollo allows our initial set of queries to return data immediately without a server roundtrip. );
Read more >Redux server side rendering breaks when using an apollo ...
1 Answer 1 ; from 'react' import ; from 'react-dom/server' import ; RouterContext } from 'react-router' ...
Read more >Blog - Next.js 13
Streaming: Display instant loading states and stream in units of UI as they are rendered. Support for Data Fetching: async Server Components and ......
Read more >Incremental Static Regeneration with Next.js - LogRocket Blog
The page is generated on the first request. Unlike in SSR, where the visitor has to wait for the data fetching, a fallback...
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 Free
Top 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
@julmot just a quick tip. You should really think about using this example. Adding too many libs like this to your project, might increase bundle sizes and complexity of code.
React has a
useReducer
hook and thecreateContext
api. For most of the use cases thats enough. In addition to that apollo provides you with the concept of localState.So ask yourself do you really need redux or apollo?
I’ve fixed, updated and refactored the example
with-apollo-and-redux
in #9270