Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

GraphQL API : Get Image details like title and description

Avatar

Level 5

I am using AEM GQL API and want to fetch the image document's metadata like title and description?

 

Currently my query looks like this:

spidey1405_0-1665579153780.png

I don't see any way to get article title and description. Can someone help me understand how can I fetch the same?

4 Replies

Avatar

Community Advisor

Hi @spidey1405,

Please refer this:

{
  adventureList {
    items {
      _path,
      _metadata {
        stringMetadata {
          name,
          value
        }
        stringArrayMetadata {
          name,
          value
        }
        intMetadata {
          name,
          value
        }
        intArrayMetadata {
          name,
          value
        }
        floatMetadata {
          name,
          value
        }
        floatArrayMetadata {
          name,
          value
        }
        booleanMetadata {
          name,
          value
        }
        booleanArrayMetadata {
          name,
          value
        }
        calendarMetadata {
          name,
          value
        }
        calendarArrayMetadata {
          name,
          value
        }
      }
    }
  }
}

Reference: https://experienceleague.adobe.com/docs/experience-manager-cloud-service/content/headless/graphql-ap...

Hope that helps!

Regards,

Santosh

Avatar

Level 5

Hi Santosh this is only for the metadata associated with that whole content fragment and not exactly the image asset.

Avatar

Employee Advisor

@spidey1405 There is no OOTB way to extract Image Ref Metadata out of a Content Fragment Query.

 

These are the only attributes available for Image Reference:

krati_garg_0-1669643964973.png

I believe a custom solution needs to be designed for such cases.

Avatar

Level 5

Hmm so through GQL Query we cannot do that unless we introduce some customization in source code? What customisation are you talking about?