-
Notifications
You must be signed in to change notification settings - Fork 181
Images are not loaded inside relations #308
Comments
@denisgoryaynov we are not extracting images for relations I guess the best way to do it would be to fetch the relationnal content type so they will be linked together in your gatsby graphiQL. So one side you populate the first level of relation and on the other side you populate the linked relations and the images. Doing so as a great advantage especially for rebuilds because in Strapi when you update a relation entity it does not change the updated_at field of the linked relations so it won't trigger a rebuild on the Gatsby side as we will still use the cached data. |
Hi, Is there any update on this issue? This has been a huge blocker for me and my team. |
You might be able to use gatsby-plugin-remote-images as a work around. You'd then have to explicitly define the GraphQL types with image urls. |
@IanSpringer are you populating the images from you relations? |
@soupette I have populated the images in my relations, yes. I actually created an issue a few days back about this same thing thinking it was a problem with relations + dynamic zones. See here https://github.com/strapi/gatsby-source-strapi/issues/336 When adding an image to a collection type, and then pulling that collection item as a relation in our dynamic zone, we cannot query localFile on the images. This is a big problem as we rely on gatsby image sharp processing. Without this capability, we will take a big hit in our performance, or run the risk of spending lots of hours on dev time to try and hack a fix. |
Fix in #344 |
I have a content type called "Product Category" with a one to many relation to itself. A "Product Category" also has a one to many relation with "Product" content type.
When dealing with the following tree:
Images for "Product" are not loaded, I can see the featured_image field inside graphql, but the localFile field is not available so I cannot use gatsby-image with it
I am using Strapi 4.2.0-beta.0 and gatsby-source-strapi 2.0.0-beta.0
Edit: at least in my case adding the following code after this line https://github.com/strapi/gatsby-source-strapi/blob/2a60320b16ae6520617d743158c433d384dbd155/src/download-media-files.js#L126 fixes the issue:
The text was updated successfully, but these errors were encountered: