Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using this with getInitialProps() in pages #6

Closed
hobbs opened this issue Nov 21, 2017 · 2 comments
Closed

Using this with getInitialProps() in pages #6

hobbs opened this issue Nov 21, 2017 · 2 comments

Comments

@hobbs
Copy link

hobbs commented Nov 21, 2017

The examples I've seen that use this library avoid using getInitialProps() in the page components, whereas the learnnextjs.com prefers doing that and then passing data into child components.

Is the recommendation to always use apollo in components and not pages? How does one use withData and graphql together?

@hobbs
Copy link
Author

hobbs commented Nov 21, 2017

Actually, I did get this to work fine in a page js via

export default compose(
    withData,
    graphql(query, {options: queryOptions}))(Event)

I think I was fighting another issue ( vercel/next.js#3234 )

@hobbs hobbs closed this as completed Nov 21, 2017
@Ponjimon
Copy link

Ponjimon commented Mar 7, 2018

@hobbs may I have an example of how you got getInitialProps to work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants