{"action":"closed","issue":{"url":"https://api.github.com/repos/apollographql/react-apollo/issues/328","repository_url":"https://api.github.com/repos/apollographql/react-apollo","labels_url":"https://api.github.com/repos/apollographql/react-apollo/issues/328/labels{/name}","comments_url":"https://api.github.com/repos/apollographql/react-apollo/issues/328/comments","events_url":"https://api.github.com/repos/apollographql/react-apollo/issues/328/events","html_url":"https://github.com/apollographql/react-apollo/issues/328","id":189448414,"number":328,"title":"Can't get full markup from \"renderToStringWithData\"","user":{"login":"novus57","id":16938595,"avatar_url":"https://avatars2.githubusercontent.com/u/16938595?v=3","gravatar_id":"","url":"https://api.github.com/users/novus57","html_url":"https://github.com/novus57","followers_url":"https://api.github.com/users/novus57/followers","following_url":"https://api.github.com/users/novus57/following{/other_user}","gists_url":"https://api.github.com/users/novus57/gists{/gist_id}","starred_url":"https://api.github.com/users/novus57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/novus57/subscriptions","organizations_url":"https://api.github.com/users/novus57/orgs","repos_url":"https://api.github.com/users/novus57/repos","events_url":"https://api.github.com/users/novus57/events{/privacy}","received_events_url":"https://api.github.com/users/novus57/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-11-15T17:00:09Z","updated_at":"2017-05-03T05:05:37Z","closed_at":"2017-05-03T05:05:37Z","body":"I can't get full page markup, only part without queries. Intial state come with data but markup doesn't full. Sorry for my English. Thanks a lot for help.\r\n```js\r\napp.use((req, res) => {\r\n  const memoryHistory = createMemoryHistory(req.url);\r\n  const user = Object.assign({}, { current: req.user });\r\n  if (user.current) {\r\n    delete user.current.password;\r\n  }\r\n\r\n  const apolloClient = new ApolloClient({\r\n    ssrMode: true,\r\n    // Remember that this is the interface the SSR server will use to connect to the\r\n    // API server, so we need to ensure it isn't firewalled, etc\r\n    networkInterface: createNetworkInterface({\r\n      uri: 'http://localhost:3000/graphql',\r\n      credentials: 'same-origin',\r\n      // transfer request headers to networkInterface so that they're\r\n      // accessible to proxy server\r\n      // Addresses this issue: https://github.com/matthew-andrews/isomorphic-fetch/issues/83\r\n      headers: req.headers,\r\n    }),\r\n  });\r\n\r\n  const initialState = { user };\r\n  const store = configureStore(memoryHistory, initialState, apolloClient);\r\n  const history = syncHistoryWithStore(memoryHistory, store);\r\n  match(\r\n    { history, routes: createRoutes(store), location: req.originalUrl },\r\n    (error, redirectLocation, renderProps) => {\r\n      if (error) {\r\n        res.status(500).send(error.message);\r\n      } else if (redirectLocation) {\r\n        res.redirect(302, redirectLocation.pathname + redirectLocation.search);\r\n      } else if (renderProps) {\r\n        const component = (\r\n          <ApolloProvider store={store} client={apolloClient}>\r\n            <MuiThemeProvider muiTheme={getMuiTheme(null, { userAgent: req.headers['user-agent'] })}>\r\n              <RouterContext {...renderProps} />\r\n            </MuiThemeProvider>\r\n          </ApolloProvider>\r\n        );\r\n\r\n        renderToStringWithData(component).then((content) => {\r\n          res.send(renderInitialView(content.markup, content.initialState));\r\n        }).catch(dataError => winston.error('RENDERING ERROR:', dataError));\r\n      }\r\n    }\r\n  );\r\n});\r\n```"}}
{"actor":{"display_login":"jbaxleyiii"}}