5.0.0 • Published 6 months ago
gatsby-transformer-rawjson v5.0.0
gatsby-transformer-rawjson
Exposes JSON values as a scalar field in GraphQL schema.
Install
npm install --save gatsby-transformer-rawjson
How to use
In your gatsby-config.js
:
module.exports = {
plugins: [
`gatsby-transformer-json`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `./src/data/`,
},
},
`gatsby-transformer-rawjson`,
],
}
How to query
Assuming a letters.json
file was loaded
{
allLettersJson {
edges {
node {
objectValue {
es
en
}
childRawLettersJson {
objectValue
}
}
}
}
}
Which would return:
{
allLettersJson: {
edges: [
{
node: {
objectValue: {
"es": "...",
"en": "..."
}
childRawLettersJson {
objectValue: {
"es": "...",
"en": "..."
}
}
},
}
]
}
}
5.0.0-alpha1
4 months ago
5.0.0
6 months ago
3.0.0-alpha1
3 years ago
3.0.0-alpha2
3 years ago
1.1.2
3 years ago
1.1.1
5 years ago
1.1.0
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago