queen.raae.codes · a developer’s logbook
← The log
1 min read

three ways to get dynamic data into your Gatsby Functions (demo)

Originally sent as a newsletter.

Written in 2021, 4 years ago. Tools and advice may have moved on since.

Hello there,

Getting started with Gatsby Function is easy peasy. You create a file in the src/api folder and copy/paste the hello-world example.

Hit the endpoint, and you get “Hello World” back.

And then you, like me, might think: “Okey, now what?”

Well, you can sign up for the Mini Bootcamp starting Saturday. We’ll create a TimeShip that stores and fetches its travel data in/from a third-party service.

Or you can have a look at the demo I just released to learn how to get data into your Gatsby Functions in three different ways: req.body, req.params and req.query — getting you one step further!

req.query

req.params

req.body

The demo is on CodeSandbox meaning you can start playing around with it right away 🎉

All the best,
Queen Raae

PS: If CodeSandbox is messing up you can also find the code on Github.
PPS: If you have any questions about the bootcamp or demo, hit reply!

Join the crew!

All the shenanigans from me and my piratical family, straight to your inbox.

Search the log

↑↓ to move · Enter to open · Esc to close All entries →