3

Pardon my limited knowledge (or rather lack of) of GraphQL, but I wasn't able to find a way to retrieve values that are added through DXA's Publish Settings using just graphs.

I was able to retrieve the variant URL of the binary of interest, but is there a direct way to get the actual content of the variant without opening a web client to the DXA website using the variant URL? I need the values in a non-public area of my architecture and if possible, I would like to avoid opening a channel to the presentation server.

binaryComponent(namespaceId:1 publicationId: 481 binaryId: 100431){
    id
    title
    variants{
      edges {
        node{
          url
        }
      }
    }
}
1

AFAIK - you could use downloadUrl to download the binary from the content service.

Alternatively, you can use the item filter query to get all the binaries in that publication which will give you all the binaries.

{
  items(filter: {itemTypes: [COMPONENT], publicationIds: 16225}) {
    edges {
      node {
        itemId
        publicationId
        ... on Component {
          multiMedia
        }
        ... on BinaryComponent {
          title
          multiMedia
          variants {
            edges {
              node {
                variantId
                path                
                type
                url
                downloadUrl 
              }
            }
          }
        }
      }
    }
  }
}

Note: This query for BinaryComponent expansion not working in 9.5 GA, you need the latest HF in content service.

1
  • Not working unfortunately. (possibly because the version of CD)
    – Atila Sos
    Sep 15 at 7:15
1

Ended up going a different way. Instead of trying to get the labels/configuration externally, now I'm pushing them from DXA to the consuming applications.

Way to obtain the settings within DXA:

string websiteConfiguration = SiteConfiguration.ContentProvider.
    GetStaticContentItem("/system/config/myModule.json",WebRequestContext.Localization).GetText()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.