https://github.com/gutenye/gatsby-transformer-lowdb
Gatsby transformer plugin for lwodb JSON files
https://github.com/gutenye/gatsby-transformer-lowdb
gatsby gatsby-plugin gatsby-transformer lowdb
Last synced: about 2 months ago
JSON representation
Gatsby transformer plugin for lwodb JSON files
- Host: GitHub
- URL: https://github.com/gutenye/gatsby-transformer-lowdb
- Owner: gutenye
- Created: 2017-05-27T15:54:35.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-07-15T02:35:56.000Z (almost 8 years ago)
- Last Synced: 2025-04-12T07:44:42.493Z (about 2 months ago)
- Topics: gatsby, gatsby-plugin, gatsby-transformer, lowdb
- Language: JavaScript
- Size: 5.86 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# gatsby-transformer-lowdb
Support [lowdb](https://github.com/typicode/lowdb) json format
## Install
```
yarn add gatsby-transformer-lowdb
```## How to use
```javascript
// In your gatsby-config.js
plugins: [
`gatsby-transformer-lowdb`,
]
```## How to store
If your project has a `db.json` with
```javascript
{
"letters": [
{ value: 'a' },
{ value: 'b' },
{ value: 'c' },
]
]
```## How to query
You'd be able to query your letters like:
```graphql
{
allLetters {
edges {
node {
value
}
}
}
}
```Which would return:
```javascript
{
allLetters: {
edges: [
{
node: {
value: 'a'
}
},
{
node: {
value: 'b'
}
},
{
node: {
value: 'c'
}
}
]
}
}
```