3

The public content API (GraphQL) does not appear to return titles of categories or keywords. The following query works, but the titles show up as null:

{
  categories(namespaceId: 1, publicationId: 10) {
    edges {
      cursor,
      node {
        itemId,
        title,
        itemType,
        children {
          edges {
            cursor,
            node {
              itemId,
              title,
              itemType
            }
          }
        }
      }
    }
  }
}

This is the response I get:

{
  "data": {
    "categories": {
      "edges": [
        {
          "cursor": "MQ==",
          "node": {
            "itemId": 29,
            "title": null,
            "itemType": 512,
            "children": {
              "edges": [
                {
                  "cursor": "MQ==",
                  "node": {
                    "itemId": 1425,
                    "title": null,
                    "itemType": 1024
                  }
                },
                {
                  "cursor": "Mg==",
                  "node": {
                    "itemId": 1431,
                    "title": null,
                    "itemType": 1024
                  }
                },
                {
                  "cursor": "Mw==",
                  "node": {
                    "itemId": 1251,
                    "title": null,
                    "itemType": 1024
                  }
                }
              ]
            }
          }
        }
      ]
    }
  }
}

From Velu's answer to my previous GraphQL question (see Does GraphQL work with default variables?), I gather that he has the same problem.

The category which contains the keywords has been published.

Am I doing something wrong (again) or is it a bug?

4

Hotfix CD_11.0.0.13730.zip is now available for this issue (via FTP or it can be requested from Support as well).

  • 1
    Great news, I will try it out asap. – Quirijn Apr 22 at 19:27
2

I get similar results in my Sites 9 setup. It could be a bug because I also cannot filter on keyword title, only on keyword key.

However you can request the Keyword key to be part of the response:

{
  categories(namespaceId: 1, publicationId: 5) {
edges {
  cursor,
  node {
    itemId,
    title,
    itemType,
    children {
      edges {
        cursor,
        node {
          itemId,
          title,
          itemType,
          key              
        }
      }
    }
  }
}
}
}
  • Thanks Philippe. Using keys instead of titles might be a work-around in some cases, but the big problem is that you don't have to give them a value (where as titles are mandatory). – Quirijn Feb 4 at 15:33

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.