-
Notifications
You must be signed in to change notification settings - Fork 19
Unknown field childImageSharp
on type File
#10
Comments
Hi @corygibbons, so sorry I missed this issue. Nothing here looks out of the ordinary. Are you able to see |
I'm experiencing the same issue. Im able to see childImageSharp and the whole schema in GraphQL, but querying for data it returns childImageSharp: null. I'm not using Gatsby v2 |
Using gatsby 2 here, but childImageSharp is not available on File here. |
I am using Gatsby v2 and I am seeing the same issue as well. I always get childImageSharp: null |
I figured out the issue. The originalSrc url coming back from Shopify has "?v=123123" at the end which is why gatsby isn't able to figure out that it's an image. I just removed this suffix and it works for me now. Not sure why shopify is adding that to the end of the url. See gatsbyjs/gatsby#6853 |
I published a package https://www.npmjs.com/package/gatsby-source-shopify2 to fix the above issues. Not sure if changes are being taken in for this project given that a pull request has been pending for a while. |
@nikhilag great! I'll try it out |
- Moves all dependencies to the latest stable release - Switches over to @nikhilag’s Shopify plugin (see angeloashmore/gatsby-source-shopify#10 for reasoning) closes #107
- Moves all dependencies to the latest stable release - Switches over to @nikhilag’s Shopify plugin (see angeloashmore/gatsby-source-shopify#10 for reasoning) closes #107
Hey everyone, sorry for the delay in response. I've been falling behind on GitHub issues/PRs due to a very busy work schedule. I'll publish an update soon with Gatsby v2 compat per the solutions noted above. |
hey @nikhilag thanks for creating a v2 of this plugin! I have a question though. I tried displaying images for my Shopify products and the screen is just blank. The following query works for me in GraphQL though:
Results:
And here's the index.js I'm trying to display the images on:
Title, description, handle etc. are all showing up on the page, but when I try to show images I just get a blank screen. Any help would be appreciated! |
You should use fragments here as mentioned in https://www.gatsbyjs.org/packages/gatsby-image/#two-types-of-responsive-images |
@nikhilag I just retested my GraphQL query by using one of the gatsby-transformer-sharp fragments - GatsbyImageSharpFluid Still not working for me. Here is my current index.js page:
|
You need to access index of images which is an array and also you are missing localFile property. So something like the following should work:- |
@nikhilag unfortunately it is still not working |
@nikhilag I'm able to query all other data (title, content, price, etc) except for product images. |
I think it's some minor issue with the code. Given that you are able to query localFile in graphiql, data is being fetched properly from Shopify. Can you share the error and also try to debug what value you are getting for images variable? |
@nikhilag I'm not receiving any errors in the cli. In browser, the screen just goes blank white. As you mentioned, data is being properly fetched from Shopify, here's what I'm seeing upon running
|
@nikhilag I think I figured out the issue...I had a product in my shopify account w/o an image associated to it. That must've thrown it off. Images are showing up for me now. Thank you for your help! |
Not sure if there's a bug or if I'm missing something but I'm having trouble interacting with images.
I've tested some image transforms when using
gatsby-source-wordpress
and everything works as excepted so hopefully I've just missed something here.Error I get is:
Relevant files:
Also have
gatsby-image
andgatsby-source-filesystem
as dependencies.Any idea what's causing this error?
The text was updated successfully, but these errors were encountered: