Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for gatsby 4 #139

Closed
amcc opened this issue Dec 1, 2021 · 13 comments
Closed

support for gatsby 4 #139

amcc opened this issue Dec 1, 2021 · 13 comments
Assignees

Comments

@amcc
Copy link

amcc commented Dec 1, 2021

Does this module support Gatsby v4, after upgrading a previously working site i'm finding inconsistent results with cloudinary images. We are using the plugin to use images on cloudinary and have a mongodb object with cloudinaryAssetData: true, this worked well for gatsby 3.

We see that nodes are transformed in the graphql on develop, they have the fixed, fluid objects present, however running develop is inconsistent, sometimes we see images, sometimes not. Build will have no images present. For the most part running develop has empty cloudinary nodes with only the very last having the src with a cloudinary URL.

It does look like the plugin hasn't been updated in a while, but if anyone can confirm whether it should run ok with gatsby 4 that would be useful and i can try to help debug whats going on here if there is an issue.

@djavco
Copy link

djavco commented Dec 1, 2021

Adding to @amcc's comment I have tried a clean install of Gatsby4 with just the Mongo plugin and gatsby-transformer-cloudinary and with the same issue.

We are seeing all the allCloudinaryAsset nodes appearing in graphQL correctly.

Only a handful of the images in our collections are getting transformed correctly. Before with lots of other plugins etc... it was only the very last image that was transformed.

We have had to customize the schema to ensure the cloudinary image object gets picked up by the plugin. See below where 'cloudinary' is the name of our image object on 'mongodbCollectionName'

 exports.createSchemaCustomization = ({ actions }) => {
   const { createTypes } = actions
   const typeDefs = `
     type mongodbCollectionName implements Node @infer {
       cloudinary: CloudinaryAsset @link(by: "id", from: "cloudinary___NODE")
     }
   `
   createTypes(typeDefs)
 }
``

@alistairlcc
Copy link

is there any progress on this issue?

@raae
Copy link
Collaborator

raae commented May 24, 2022

@olavea and I are tasked with getting this plugin up-to-date 🥳

We are looking into v4 compatibility as we speak.
If you have any additional information to add, now would be great time to do so 🙏

@amcc
Copy link
Author

amcc commented May 24, 2022

@raae thanks for the update.

Perhaps one thing to roll in is this PR i made: #140
Its very simple, and we are using a patched version on our project - just a one liner to allow cloudinary nodes to be empty objects.

We are using mongodb as a backend, not sure that will be relevant to what you're doing, but it would obviously be wonderful that it works for us, i'm happy to test out any developments when you have them, just send me a branch or something. Also tell me if there's anything i should look at to help you out, right now we get no errors - just a bunch of null cloudinary nodes in graphql

@raae
Copy link
Collaborator

raae commented May 25, 2022

Could you share the minimal repo with me @amcc?

@amcc
Copy link
Author

amcc commented May 25, 2022

yep i can do that - probably can't give access to the db though, i'll create and grant you access asap.

Would you like the working version - currently in gatsby v3, or a version that has had various modues updated to gatsby 4, but fails to work with cloudinary. I suspect the v3 might be more useful as its relatively easy to upgrade from that point - however without db access you wont be able to run it anyway.

@raae
Copy link
Collaborator

raae commented May 26, 2022

The latter, then I can probably create a mongodb myself.

PS: I am pretty sure I figured out what is breaking.

@raae
Copy link
Collaborator

raae commented Jun 2, 2022

I managed to add examples to the demo site that breaks this so we'll work with that @amcc. But as soon as we have something testable I'll reach out.

@amcc
Copy link
Author

amcc commented Jun 2, 2022

sorry i've not got something back to you yet - swamped with a project launching - but much more free in a week or so, let me know if you still need something, or want something testing as thats very easy

@raae
Copy link
Collaborator

raae commented Jun 20, 2022

There will be a published beta tag soon for you to test 🎉

@raae
Copy link
Collaborator

raae commented Jun 22, 2022

The beta is out @amcc, @djavco, @alistairlcc.
Take a look at #163 for test procedures.

The new approach works both in Gatsby v3 and Gatsby v4, so you can move to gatsby-transformer-cloudinary@beta-v4 (and later @3.0.0) before moving to Gatsby v4. Hopefully making it a smoother transition.

@raae
Copy link
Collaborator

raae commented Jul 5, 2022

Have you been able to the the gatsby-transformer-cloudinary@beta-v4 @amcc with your mongo db setup?

@cloudinary-raae
Copy link
Contributor

cloudinary-raae commented Jul 27, 2022

Released: v3.0.0

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

No branches or pull requests

5 participants