gatsby-plugin-remote-images icon indicating copy to clipboard operation
gatsby-plugin-remote-images copied to clipboard

Nested name field

Open jsbrain opened this issue 5 years ago • 4 comments

I'm trying to resolve an image on level n and want to have the resulting sharp object to be on the same level n but I realized that this doesn't seem to work as the sharp object always appears on the first level.

This is what I want to achieve:

imagePath: "author.profile_image",
name: "author.featureImageSharp",

But this config fails as punctuation on the name prop doesn't seem to be allowed.

Is there actually a way to do it or is this not supported?

jsbrain avatar Jul 05 '20 17:07 jsbrain

@jsbrain Oh that looks like a cool use case! That is not currently supported.

graysonhicks avatar Jul 06 '20 16:07 graysonhicks

Would really love to have that feature. Would be incredibly useful to me (and probably others) 😀 Do you see any obstacles implementing this?

jsbrain avatar Aug 23 '20 08:08 jsbrain

@jsbrain Just time! 😆 The get function is already used for this use case, but in the opposite direction. I believe the set function from lodash would do what we need when setting the field. See here for its docs: https://lodash.com/docs/4.17.15#set.

graysonhicks avatar Aug 25 '20 12:08 graysonhicks

@graysonhicks Yeah same same ... 😆 Ok cool I might look into it and create a PR if I find the time and get something useful there :)

jsbrain avatar Aug 25 '20 13:08 jsbrain