Expand my Community achievements bar.

Submissions are now open for the 2026 Adobe Experience Maker Awards.
SOLVED

Graph QL Query not returning image path.

Avatar

Level 2

Implementation Details :-
1. In Content Fragment Model Editor we are using Content Reference with type Image.
    

Randeep_virk_0-1757400141082.png

2. Now using this model we have added path to image.

Randeep_virk_3-1757400630945.png

 




3. Its getting stored in correct manner in crx/de.

Randeep_virk_1-1757400201108.png

4. Graph QL Query returning null.

Randeep_virk_2-1757400503848.png

Note - Its AEM as CS Local set up.

 



Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Randeep_virk,

In Local SDK, the ImageRef._dynamicUrl field is not populated (it’s provided by Asset Delivery, which only works in the cloud env after it’s configured). When you query:

image {
  ... on ImageRef { _dynamicUrl }
}

the resolver can’t produce a Dynamic Media/Asset-Delivery URL locally, so the field comes back null - even though your image property is set correctly (you can see the path stored at /content/dam/securbank/pages/sb-home.png in CRXDE).

Here is what you can do:

Local SDK (recommended)
Query the fields that are available locally and build the URL yourself:

items {
  image {
    ... on ImageRef {
      _path
      _id
      _name
      _mimeType
      # if available in your SDK build:
      _authorUrl  # often works locally; use this directly
      # _publishUrl  # works when the asset is published in a cloud env
    }
  }
  title
  content { plaintext }
}
  • Use _authorUrl in local dev, or construct a URL from _path
    (e.g., https://localhost:4502${_path} for author, or your dispatcher/publish host when testing publish).

Cloud environment
If you want _dynamicUrl:

  1. Configure Asset Delivery (Tools → Assets → Configuration) for your cloud env.

  2. Publish the asset, the content fragment, the model, and the GraphQL endpoint.

  3. Then the same query with _dynamicUrl will return a value.


Santosh Sai

AEM BlogsLinkedIn


View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @Randeep_virk,

In Local SDK, the ImageRef._dynamicUrl field is not populated (it’s provided by Asset Delivery, which only works in the cloud env after it’s configured). When you query:

image {
  ... on ImageRef { _dynamicUrl }
}

the resolver can’t produce a Dynamic Media/Asset-Delivery URL locally, so the field comes back null - even though your image property is set correctly (you can see the path stored at /content/dam/securbank/pages/sb-home.png in CRXDE).

Here is what you can do:

Local SDK (recommended)
Query the fields that are available locally and build the URL yourself:

items {
  image {
    ... on ImageRef {
      _path
      _id
      _name
      _mimeType
      # if available in your SDK build:
      _authorUrl  # often works locally; use this directly
      # _publishUrl  # works when the asset is published in a cloud env
    }
  }
  title
  content { plaintext }
}
  • Use _authorUrl in local dev, or construct a URL from _path
    (e.g., https://localhost:4502${_path} for author, or your dispatcher/publish host when testing publish).

Cloud environment
If you want _dynamicUrl:

  1. Configure Asset Delivery (Tools → Assets → Configuration) for your cloud env.

  2. Publish the asset, the content fragment, the model, and the GraphQL endpoint.

  3. Then the same query with _dynamicUrl will return a value.


Santosh Sai

AEM BlogsLinkedIn


Avatar

Level 2

Thanks , ITS Working Now !!  @SantoshSai