Rocketmakers / gatsby-plugin-graphql-image

A gatsby plugin for generating file nodes from remote image URLS in GraphQL API's
2 stars 6 forks source link

gatsby-plugin-graphql-image

Description

Traverses a grapqhl schema sourced from the gatsby-source-graphql plugin and generates file nodes for use with gatsby-plugin-sharp and gatsby-transformer-sharp.

Dependencies

gatsby-source-graphql
gatsby-source-filesystem
gatsby-plugin-sharp
gatsby-transformer-sharp

How to install

npm i -D gatsby-plugin-graphql-image

Available options

images - An array of objects with these options

Examples of usage

{
  resolve: "gatsby-source-graphql",
  options: {
    typeName: "ROCKETMAKERS",
    fieldName: "rocketmakers",
    url: "https://rocketmakers.com/graphql"
  }
},
{
  resolve: 'gatsby-plugin-graphql-image',
  options: {
    images: [
      {
        schemaName: 'ROCKETMAKERS',
        typeName: 'ROCKETMAKERS_UploadFile',
        fieldName: 'url',
        baseUrl: 'https://rocketmakers.com',
      },
    ]
  }
}