 [ ← blog / 24for2019 ](/) Dec 01, 2019  ·  \#24for2019  ·  3 min read 

# Revisiting GatsbyJS and Drupal Commerce



The Drupal community has taken to [GatsbyJS](https://www.gatsbyjs.org/), the React framework that lets you easily build static (and more) websites (or applications.) And, honestly, this makes a lot of sense. Drupal is a great content management system and it even has ways to create microsites within one installation (thanks to techniques like the Domain module.)

My first experience with GatsbyJS was in preparing a demonstration of decoupled Drupal Commerce for [Decoupled Days 2018](https://2018.decoupleddays.com/session/road-headless-drupal-commerce-future). I had copied the Umami demo someone had written and got it working with Drupal Commerce. In fact, it is still up and running here: <https://gatsbyjs.demo.centarro.io/product/drupal-commerce-hoodie>. The code is also available on [GitHub](https://github.com/mglaman/gatsbyjs_commerce_demo/tree/decoupled-days-2018). Back then I had to fork the Drupal source plugin to make things work. The JSON:API module was still a contributed module, and some spec implementation improvements had broken the plugin.

Since that time, my work at Centarro has been doubling down on the API-First capabilities of Drupal Commerce and the developer experience of JSON:API ([Supporting cross-bundle entity collections in JSON:API](https://www.centarro.io/blog/supporting-cross-bundle-entity-collections-jsonapi), [Querying Drupal Search API indexes using JSON:API](https://www.centarro.io/blog/querying-drupal-search-api-indexes-using-jsonapi).)

The community has also grown in its usage of GatsbyJS. I'm hoping to get back into the arena and see what can be done with GatsbyJS and Drupal Commerce for a decoupled storefront.

This past week I had a discussion with [Shane Thomas](https://www.drupal.org/u/codekarate) about Drupal Commerce and GatsbyJS. I used this opportunity to review the [documentation for GatsbyJS themes](https://www.gatsbyjs.org/docs/themes/what-are-gatsby-themes). Themes are composable, which means they can provide components and templates used in your GatsbyJS site. Perhaps this allows a prebuilt product template and add to cart component that "just works" with the Drupal Commerce data model 🤔? Time will tell.

[Lee Rowlands](https://www.drupal.org/u/larowlan) pinged me while he was at Drupal South and I was spending Thanksgiving at my parent's house. He asked about some of our recent API initiatives work for Drupal Commerce and how he may lend a hand. I didn't have much for an answer, as we're in discovery / make a mess mode. There is a Gatsby-ECommerce plugin that works with Moltin, an API-First eCommerce SaaS. He's experimenting plugging Drupal Commerce into that plugin. 🥳I hope to sync with him and see how that's going.

I'll be reading up on the following blogs as well to bring myself up to speed on Drupal + GatsbyJS

- [GatsbyJS + Drupal: Create Content Type Landing Pages](https://www.jamesdflynn.com/development/gatsbyjs-drupal-create-content-type-landing-pages)
- [GatsbyJS + Drupal: Create Custom GraphQL Schema for Empty Fields](https://www.jamesdflynn.com/development/gatsbyjs-drupal-create-custom-graphql-schema-empty-fields)
- [Using Drupal Blocks in a Decoupled GatsbyJS Application](https://www.jamesdflynn.com/development/using-drupal-blocks-decoupled-gatsbyjs-application)
- All of Shane's Gatsby posts on [CodeKarate](http://codekarate.com/category/tags/gatsbyjs)

 

  ![](/themes/custom/mglaman/images/headshot.webp)Thanks for reading

I write about Drupal, PHP, and the quiet infrastructure behind large sites — caching, config, and testing. New posts land every week or two.

 [Subscribe via RSS →](/rss.xml) [About me →](/about-me) 

 



 

  [← Older

Gearing up for the 2020 conference season

 ](/blog/gearing-2020-conference-season) [Newer →

Improving the handling of Drupal JSON:API hyperlinks in GatsbyJS

 ](/blog/improving-handling-drupal-jsonapi-hyperlinks-gatsbyjs)