-
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
gatsby with graphql won't load new data #2847
Comments
While in development mode, the server will watch for changes to files and rebuild/update accordingly. In production, this is a static site and content is only updated when you do a fresh build and deploy to your host. There is no way for Gatsby to know that you made changes to your database. Firebase would need to trigger an event to your CI server that you need a new build. Another approach is to not use Firebase as a source and have it update content dynamically in your app. But then you are losing some of advantages of having static compiled content. |
Just to add, I would make sure that using Firebase is necessary. Can you not achieve the same outcome using markdown or yaml? This would make things simple and easy to maintain. |
What if there was an optional flag when restarting the server that allows you to add a query parameter that refetches from your data source? Perhaps, the server could accept post requests to trigger rebuilding the schema and pulling data, so data sources could use webhooks. Use case: our content editors want to preview their entries before publishing. I would be interested in working on something like this, but could use a little guidance through the code, since I'm new to the project. |
Any thoughts on this proposed solution? Would gatsby be amenable to one of these or some variation thereof? |
My preferred solution is the last idea here #2271 (comment) We'd expose a way to run commands while |
You want to run |
Admittedly not the greatest option, but it would be behind an oauth proxy so only users in our organization can access the site. How are other people serving up previews of their site? |
I like the version of using a source plugin to add new nodes. Was not aware that was a supported use case. Perhaps I could add this as an option for gatsby-source-contentful |
Being able to run a |
Sending you an email @bjrn |
This is also my use case with prismic instead of contentful. I dont really understand why we could not start Pushing that concern for this particular use case (preview mode) to each individual source plugin does not seem like the right approach.
I dont really see any other way to let authors preview their contents before it's getting published. And for many working with a headless CMS, this is really mandatory for adoption. There is definitely a legitimate use case to run gatsby on a server in order to provide previews imho and it seems It could probably be a good idea to introduce |
I agree with @tlvenn , a gatsby preview server sounds like the ideal solution. It could offer a basic version to allow re-bootstraping before handling requests, taking the responsibility off the plugins. Even better would be to expose an API to receive webhooks from data sources and allow source plugins to update accordingly. I took a look at the filesystem source plugin as @KyleAMathews recommended and noticed it was using chokidar to watch filesystem changes. At first I thought I could hook into |
Well, my solution was working when i was running gatsby locally and using When the endpoint is hit, |
I did a git bisect and found that the |
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! |
Hey guys This conversation is already quite old, but I'm wondering what the outcome was. We have setup right now where the editors trigger a webhook whenever they publish a page which starts a build on Netlify. So, I'm looking into solutions to that problem and also had the idea of running a development server on a web server somewhere and then make use of hot reloading. However, I need to refetch the data from our CMS (neither prismic nor contentful) ideally without stopping and starting the server. That's how I ended up reading this thread which is probably the closest to this idea. Was the problem solved in Gatsby? |
I sourced my data with |
I just randomly found my comment from 1.5 years ago (#2847 (comment)) and given the number of reactions on that comment I want to leave this here: The Gatsby Cloud service is the very idea that I'm proposing in the comment. |
Hi guys, Any update on this "refreshing of graphQL content/data"? |
I have an issue - gatsby with graphql won't update data from database ( firebase ).
npm run develop
) in mygatsby-node.js
data fetched and dynamic pages created.localhost:8000/___graphql
There is only old dataAnd i have to do it always to see new data.
Any solutions on this?
Thanks!
gatsby-node.js
gatsby-config.js
The text was updated successfully, but these errors were encountered: