diff --git a/examples/with-apollo/lib/withData.js b/examples/with-apollo/lib/withData.js index 70569e1801265..240aae39e2630 100644 --- a/examples/with-apollo/lib/withData.js +++ b/examples/with-apollo/lib/withData.js @@ -11,10 +11,15 @@ export default (Component) => ( const client = initClient(headers) const store = initStore(client, client.initialState) + const props = { + url: { query: ctx.query, pathname: ctx.pathname }, + ...await (Component.getInitialProps ? Component.getInitialProps(ctx) : {}) + } + if (!process.browser) { const app = ( - + ) await getDataFromTree(app) @@ -28,7 +33,8 @@ export default (Component) => ( data: state.apollo.data } }, - headers + headers, + ...props } } @@ -41,7 +47,7 @@ export default (Component) => ( render () { return ( - + ) }