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.
gatsby-source-graphql
gatsby-source-filesystem
gatsby-plugin-sharp
gatsby-transformer-sharp
npm i -D gatsby-plugin-graphql-image
images
- An array of objects with these options
schemaName
- The typeName value of your graphql source from the gatsby-source-grapql plugin typeName
- The actual graphQL typeName (you can query __typename
in GraphiQL to get the actual typeName) fieldName
- The name of the field that contains your image URLs baseUrl
- (optional) A base url to use in case the values are not absolute paths{
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',
},
]
}
}