-
Notifications
You must be signed in to change notification settings - Fork 183
Allow child image sharp on arrays of images #90
Conversation
Nice. When will this be available? |
Really nice. Hope it will be merged. |
Any news on this?? |
@soupette this PR does not appear to work with childImageSharp plugin for optimizing images. |
@Naismith do you suggest to close it? |
@Naismith did you find any issues? I'm currently using this version on my company's website with no problems but there may be some use cases I didn't consider when modifying the code, I can take a look and try to fix the issues if you have any feedback |
@denisgoryaynov when looking at Gatsby's __graphql route, the images did not seem to have a localFile key, so I was unable to use the childImageSharp plugin on the images. I will test again tonight to make sure I didn't do anything wrong. @soupette would you confirm if you have any issues? |
@Naismith I don't know if this is the case, but the localFile key exists only on arrays of images, when using a single image you can access fields like publicURL directly from the image
|
Just tested again, it seems to be working fine for me now. I do wonder if there's a way we can do this without the 'localFile'. So that we can have a similar API with multipleImages as we do with singleImages. But if @soupette is cool with how the current API is for multiple images, then I say it's good. |
This is a great feature and should be merged when its ready and tested, but when i was trying out the new versions i started getting errors when running
Now, i am not an expert and this could be something i am doing wrong but here is what i saw:
When i reverted the change and went back to version 0.0.10, everything stated working again. Any suggestions are welcome :) |
@likw1d the master branch of my fork is missing the compiled files that you would normally have when installing gatsby-source-strapi from npm, for now you can just add this line to your package.json:
and then run |
Thank you @denisgoryaynov, i just tried it again following your suggestion and works like a charm! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks a lot for your contribution!
I'll try to make a release soon!
@Naismith Let's release it! |
when are we tagging a 0.11 release? can't seem to install straight from yarn add https://github.com/strapi/gatsby-source-strapi.git. Constantly getting Using Thanks @denisgoryaynov for your work |
This issue is still present. Thanks to @denisgoryaynov, your solution works great! |
Thanks @denisgoryaynov Working like a charm, I had to use your forked version because this problem still persist on current version 0.12 |
Right now it's not possible to query File properties on arrays of images, for example this results in an error:
this pull request fixes the issue by allowing to query a localFile field on arrays of images: