Image url in GraphQL

Enonic version: 7.9.2

Hi all,

How can I get a version of an image for each items in a query? Let’s say I have this:

{
  guillotine {
    query(
      contentTypes: "event"
      first: 100
      sort: "data.event_start desc"
    ) {
      displayName
      ... on Event {
        _id
        _path
        displayName
        data {
          event_start
          image {
            _path
          }       
        }
      }
    }
  }
}

With _path I get the original file url (which dowsn’t work in frontend anyway), but what I want is a more usable version using the imageUrl function:

imageUrl( 
          type: absolute, 
          scale: "block(600,700)", 
          filter: "grayscale(); border(10, 0x000000)")

Any help is appreciated :slight_smile:

here is an example


images {
            ... on media_Image {
                  imageUrl(type: absolute, scale: "block(640, 360)")
                  displayName
            }

4 Likes