question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Apollo & Redux example doesn't wait for data during SSR rendering

See original GitHub issue

Examples 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

000230

System information

  • OS: Windows 10
  • Browser Firefox 70
  • Version of Next.js: 9.0.6

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
HaNdTriXcommented, Oct 31, 2019

@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 the createContext 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?

1reaction
HaNdTriXcommented, Oct 31, 2019

I’ve fixed, updated and refactored the example with-apollo-and-redux in #9270

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found