Skip to main content
New Participant
October 12, 2022

GraphQL API : Get Image details like title and description

  • October 12, 2022
  • 2 replies
  • 1931 views

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:

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

krati_garg
Employee
November 28, 2022

@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:

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

New Participant
November 29, 2022

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

SantoshSai
New Participant
November 25, 2022

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-api/sample-queries.html?lang=en#sample-wknd-metadata

Hope that helps!

Regards,

Santosh

Santosh Sai
New Participant
November 28, 2022

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