GraphQLError: Field "asset" of type "SanityImageAsset" must have a selection of subfields. Did you mean "asset { ... }"?
) I get the runtime error
can't access property "split", id is undefined
. I can resolve the issue by just passing the
asset.id
but this isn't what the documentation shows. This also breaks with the same error if I query the image for
gatsbyImageData
, which the
gatsby-plugin-image
docs have lead me to believe is how the new image plugin works. I feel like the documentation is missing something? Does anyone have some experience with this? Any help appreciated!
Apr 2, 2021, 4:08 AM
E
Hello! I had this same problem - seems to be resolved if you just pass in asset.id. So far that is working from me, but yeah that isn't clear in the docs I had to figure it out too.
Apr 2, 2021, 5:37 PM
T
Hi, yes I have been experiencing all of those same problems....
Apr 6, 2021, 5:40 AM
S
I’ve been agonizing over this issue for a good chunk of the day and the asset.id thing worked for me. Thank you!