cloudinary-community / gatsby-transformer-cloudinary

Use Cloudinary images with gatsby-image for high performance and total control!
https://gatsby-transformer-cloudinary.netlify.app/
MIT License
69 stars 28 forks source link

fix: no direct mutation of nodes (to support Gatsby v4) #163

Closed olavea closed 2 years ago

olavea commented 2 years ago

Closes #156

raae commented 2 years ago

Instead of the adding cloudinaryAssetData: true to the data defining the Cloudinary asset, the user will have to configure the plugin with the GraphQL types defining the Cloudinary asset. No new nodes will be created for these assets, the image resolvers will be added onto the exiting type.

raae commented 2 years ago

We need help testing this PR, especially on existing larger projects 🙏 It has the same changes as #173, but also adds support for Gatsby v4 🎉 However it still works with Gatsby v3, so test it with your current set up first.

Install the beta version:

CleanShot 2022-06-22 at 14 42 06@2x

Test that your gatsby-image components still works in v3:

Test that your gatsby-image components still works in v4:

It would also be great if you could test that gatsby-plugin-image works with v4 or v3:

Migration can be done one query at the time, no need to migrate all at once as the fluid and fixed resolvers are still there together with the new gatsbyImageData. Check out the examples for gatsby-image and gatsby-plugin-images side by side.