menu
up-caret
down-caret

Gatsby.js

A channel about Gatsby, which includes GraphQL, React, static site generators, Redux, JavaScript, serverless.

# General

General Chatter

Trending conversations
Share your stack...I'd love to see what you use the most in combo with Gatsby
@block-guy-eddie · 1d
Been at this for months 😓 Preserving routes in production?
@ahrjarrett · 1h
How do I access client_secret.json in production?
@mckvr · 17h
"Shortcodes" Within Gatsby
@nickreese · 5d
Greater than operators in graphql?
@dakuan · 31d

How would you store large amounts of data submitted through a Gatsby site?

Gatsby.js/General · September 10, 2018 at 11:14pm

How would you store large amounts of data submitted through a Gatsby site?

September 10, 2018 at 11:14pm

We're using Gatsby for http://stateofjs.com/ but we're currently offloading the survey itself to Typeform (http://typeform.com/).

In the future it'd be great to have the survey be handled by Gatsby as well so we have total control over the whole experience. I'm just not sure where to submit the data to.

Assuming we don't want to go through the trouble of setting up our own API server and back-end, what would you recommend?

For example I know Netlify has a Forms feature that lets you submit and store data, so that would be one option. Any other suggestions?


September 10, 2018 at 11:16pm

To clarify, the ideal solution would be something that has an API that can work with a React front-end as well as some kind of back-end to view/sort/export survey results. And ideally some security features as well to prevent people messing up with the data too much.

  • reply
  • like

A hosted GraphQL service sounds ideal to me.

  • reply
  • like

A hosted GraphQL service sounds ideal to me.

Prisma Cloud perhaps (prisma.io)

  • reply
  • like

I guess Prisma Cloud is a replacement for Graphcool?

  • reply
  • like

I guess Prisma Cloud is a replacement for Graphcool?

Kind of yes and kind of no. It's not a 1:1 replacement since you have to attach something like AWS to it (if I recall correctly). Still kind of confused by all this. Graph.cool still works and I've been using it lately.

  • reply
  • like

does Gatsby include any features that would potentially make it easier to use a GraphQL-based back-end? (I know it can make it easier to load and display data from it, but I mean for the mutation part)

  • reply
  • like

does Gatsby include any features that would potentially make it easier to use a GraphQL-based back-end? (I know it can make it easier to load and display data from it, but I mean for the mutation part)

Not that I know of (still a Gatsby noob) but you could always extend it using something like this: https://github.com/prisma/graphql-request

  • reply
  • like

October 16, 2018 at 7:02am

I would go with Airtable. (Collecting data via Airtable can be a good choice too.)

  • reply
  • like

October 16, 2018 at 1:34pm

@sasha do you mean using something like Apollo? I see where you're confused (I am too), which is that Gatsby uses GraphQL to query data internally, but what about using GraphQL to query data from somewhere else? I have been looking into this too, and maybe the following links might help:

https://medium.com/@dwalsh.sdlr/gatsby-apollo-graphcool-netlify-the-webs-promised-land-6dd510efbd72

https://www.npmjs.com/package/gatsby-apollo

  • reply
  • like

October 19, 2018 at 10:56pm

@sasha do you mean using something like Apollo? I see where you're confused (I am too), which is that Gatsby uses GraphQL to query data internally, but what about using GraphQL to query data from somewhere else? I have been looking into this too, and maybe the following links might help:

https://medium.com/@dwalsh.sdlr/gatsby-apollo-graphcool-netlify-the-webs-promised-land-6dd510efbd72

https://www.npmjs.com/package/gatsby-apollo

It depends on the data. If the data is mostly static and you want to bake it into the static site, then you'd need to create a source plugin for Gatsby if one doesn't already exist. If the data is dynamic like @sacha's survey, you are pretty much on your own on the frontend. Meaning you'll need to setup Apollo if you want to use GraphQL, or use fetch to hit an API.

I do both on my website. I built a source plugin to pull GitHub event data that is mostly static (or I don't care of it's stale), and use fetch to query Last.fm to display the song I'm currently listening to.

  • reply
  • like

October 31, 2018 at 11:31am

It depends on the data. If the data is mostly static and you want to bake it into the static site, then you'd need to create a source plugin for Gatsby if one doesn't already exist. If the data is dynamic like @sacha's survey, you are pretty much on your own on the frontend. Meaning you'll need to setup Apollo if you want to use GraphQL, or use fetch to hit an API.

I do both on my website. I built a source plugin to pull GitHub event data that is mostly static (or I don't care of it's stale), and use fetch to query Last.fm to display the song I'm currently listening to.

That's awesome! Thanks man

  • reply
  • like

November 1, 2018 at 8:48pm

You can use Netlify functions and have that function submit your data to say a Google sheet or something else with API access or just send the result with an email. Depends on your requirements. https://www.netlify.com/docs/functions/ for high very high volume, you can use Lambda as it will be cheaper than Netlify.

  • reply
  • like