-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Include Apollo client-side #3650
Comments
I'm also getting build errors when doing I can include the My hunch is that it's a conflict with the
|
So I fixed my issue and it was a package conflict. I was including Here is my working
|
I have struggle for days on this. I will make a post on how to set Apollo because this was the most painful experience of my life. In the meantime for any struggling souls out there... @shwanton As of the time of this post, you can now use package.json:
gatsby-ssr.js
gatsby-browser.js
Whatever fetch apollographql/apollo-client#3590 which lead me to their docs:
|
@Legym Very nice, thank you. Do you have an example repository? Please add a link to this issue when your blog is ready! |
i just deployed to netlify and it works.
|
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
by adding redux the build broke, so I had to add the gatsby-ssr file (even if there's no plan to support SSR) so the build won't fail gatsbyjs/gatsby#3650
Coming to this late, but I found
Coming in late, but figured I'd mention a reference to a working repo of gatsby and apollo here: |
hey i followed the process of adding apollo clien by referencing https://github.com/jlengstorf/gatsby-with-apollo (H/T @jlengstorf) |
Description
I understand that Gatsby v2 will allow to have dynamic data client-side (e.g. to load user-specific data from some remote GraphQL API) which is great and I'm eagerly waiting for this. However as there's no ETA on v2 and I need to start with this now, I tried to integrate an Apollo GraphQL client myself (just querying a GraphQL API which has nothing to do with Gatsby) by rendering the component with the GraphQL query after
componentDidMount
has executed.It works great in dev, but after building statically and opening the website I get this browser error:
There seems to be an error thrown at http://localhost:9000/component---src-layouts-en-js-851bbd767d539b6973bc.js:1:19724, but I have no idea how to know what it is, or why the error is not relayed properly.
Would you have any advice?
Environment
Gatsby version: 1.9.164
Node.js version: 9.4.0
Operating System: macOS High Sierra 10.13.2
File contents (if changed):
See #3582 (comment)
Actual result
Browser error, GraphQL component does not render.
Expected behavior
No browser error, GraphQL component shows query result which gets queried successfully in dev mode.
Steps to reproduce
The text was updated successfully, but these errors were encountered: