Skip to content
This repository has been archived by the owner on Dec 22, 2018. It is now read-only.

allShopify Article gatsby-image-sharp not working #22

Open
jserrao opened this issue Nov 30, 2018 · 0 comments
Open

allShopify Article gatsby-image-sharp not working #22

jserrao opened this issue Nov 30, 2018 · 0 comments

Comments

@jserrao
Copy link

jserrao commented Nov 30, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant