Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

jroehl/gatsby-transformer-estates

Repository files navigation

gatsby-transformer-estates

Build Status npm Code Style semantic-release

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

About

A gatsby transformer plugin to sanitize data coming from gatsby-transformer-estates plugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published