gatsby-transformer-estates
v1.2.0
Published
A gatsby transformer plugin to sanitize data coming from gatsby-transformer-estates plugin
Downloads
8
Maintainers
Readme
gatsby-transformer-estates
This plugin transforms the estates that where fetched by the gatsby-source-is24 plugin. The properties are normalized and reduced to the keys in the config file. The fields and maxDimensions of the attachments can additionally be specified as options.
Install
npm install --save gatsby-transformer-estates
How to use
// In your gatsby-config.js
// without options
`gatsby-transformer-estates`
// OR
// with options
plugins: [
resolve: `gatsby-transformer-estates`,
options: {
// optional option properties
// fields = [default_fields], // The whitelisted fields to be kept in sanitized data
// maxDimensions = { // the max dimensions the image urls should be scaled to
// height: 3000,
// width: 3000
// },
}
]
How to query
You can query npm nodes like the following
allEstatesSanitized {
allIs24EstatesSanitized {
edges {
node {
id
title
}
}
}
}
singleEstateSanitized {
is24EstatesSanitized(id: { eq: "123456" }) {
id
title
}
}
TODO
- write tests
- Roll out for other types