angeloashmore / gatsby-source-shopify

Source plugin for pulling product data into Gatsby from a Shopify store
36 stars 19 forks source link

allShopify Article gatsby-image-sharp not working #22

Open jserrao opened 6 years ago

jserrao commented 6 years ago

Sample query for ShopifyArticle yields null in GraphiQL for the childImageSharp field despite there definitely being imagery in there.

  {
      allShopifyArticle {
        edges {
          node {
            id
            title
            contentHtml
            excerpt
            blog {
              title
            }
            author {
              name
            }
            publishedAt(formatString: "YYYY-MM-DD")
            image {
              localFile {
                name
                childImageSharp {
                  fluid(maxWidth: 800) {
                    aspectRatio
                    base64
                    sizes
                    src
                    srcSet
                    srcSetWebp
                    srcWebp
                  }
                }
              }
            }
          }
        }
      }
    }

A more normal query on image works just fine:

{
     allShopifyArticle {
        edges {
          node {
            id
            title
            contentHtml
            excerpt
            blog {
              title
            }
            author {
              name
            }
            publishedAt(formatString: "YYYY-MM-DD")
            image {
              src
              id
              altText
            }
          }
        }
      }
    }

I hunted through how this is implemented and it's not clear to me exactly how you're tapping into file system within Gatsby to pull this off otherwise I'd PR you. Let me know and I can provide more info if this isn't enough to recreate on your end.