How to GROQ an Avatar into an Asset URL

6 replies
Last updated: Jul 31, 2021
Hello!
I have an array of items nexted within an object.


    testimonailSection {
      testimonials {
        "avatar": avatar.asset->url,
        ...
      },
      ...
    },
trying to groq an avatar into the asset url, but not sure how to properly do this. does not seem to be working.
Jul 31, 2021, 6:11 PM
HeyDid you try something like
testimonials[] -> {} ?
Jul 31, 2021, 6:13 PM
still seems to be going like this
Jul 31, 2021, 6:15 PM
tried
    section {
      testimonials[] -> {
        "avatar": avatar.asset->url,
        ...
      },
      ...
    },
Jul 31, 2021, 6:15 PM
i might have a type duplication am gonna debug that quick will let u know
Jul 31, 2021, 6:16 PM
user E
nah still comes thru as the same
Jul 31, 2021, 6:22 PM
I am just gonna use the imageBuilder for this 🙂 Thank you!
Jul 31, 2021, 7:10 PM

Sanity.io – build remarkable experiences at scale

Sanity is a customizable solution that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Categorized in