Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-transformer-lowdb

Support lowdb json format

Install

yarn add gatsby-transformer-lowdb

How to use

// In your gatsby-config.js
plugins: [
  `gatsby-transformer-lowdb`,
]

How to store

If your project has a db.json with

{
  "letters": [
    { value: 'a' },
    { value: 'b' },
    { value: 'c' },
  ]
]

How to query

You’d be able to query your letters like:

{
  allLetters {
    edges {
      node {
        value
      }
    }
  }
}

Which would return:

{
  allLetters: {
    edges: [
      {
        node: {
          value: 'a'
        }
      },
      {
        node: {
          value: 'b'
        }
      },
      {
        node: {
          value: 'c'
        }
      }
    ]
  }
}
© 2023 Gatsby, Inc.