Expand my Community achievements bar.

AEMaaCS GraphQL: Sorting, tags and page reference

Avatar

Level 2

Hello!

We are struggling with a GraphQL query on our AEMaaCS publish instance.

For showing certain news on our Android and iOS mobile apps, we'd like to query a list of article content fragments...

  • of a specific path
  • after specific date
  • sorted by date
  • having a particular cq:tags tag set
  • returning the _publishURL of the page that references the content fragment

Current state:

  • Date works.
  • Path works.
  • Sorting by date will be supported with the March 2023 release.
  • Checking for tags did work in AEM 6.5 but now it seems it does not work anymore? Do we miss something?
  • The _references attribute only returns "RTE inline references" and not the page(s) that reference the content fragment. Is there a way to accomplish that?

Our current query:

query {
  articleList(
    # does not work
    # sort: "articleDate DESC",
    filter: {
      _path: {
        _expressions: [
        {
          # Path e.g. /content/dam/gpa/articles
          value: "/content/dam/oegb/articles"
         _operator: STARTS_WITH
        }]
      },
      articleDate: {
        _expressions: [
        {
          # Datetime of last time queried by client
          value: "2023-02-15T00:00:00.000Z"
         _operator: AFTER
        }]
      },
      # does not work
      # _tags: {_expressions: [{value: "meinbrapp", _operator: CONTAINS}]}
    }) {
    items {
      _path
      topic
      title
      subtitle
	    articleDate
      previewText {
        html
      }
      mainText {
        html
      }
      _metadata {
        stringArrayMetadata {
          name,
          value
        }
      }
    },
    _references {
      ... on PageRef {
        _publishUrl
      }
    }
  }
}

 

Any hint is appreciated.

 

Thank you!

 

 

1 Reply

Avatar

Administrator

@AsifChowdhury @Shiv_Prakash_Patel @nitesh_kumar @Rohit_Utreja 

Can you please dedicate some time to review this AEM question and offer your expert insights? Additionally, if you could provide the author with some guidance or direction to tackle the problem, it would be most appreciated.



Kautuk Sahni