5

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?

2 Answers 2

5

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

2
  • 1
    Great news, I will try it out asap.
    – Quirijn
    Commented Apr 22, 2019 at 19:27
  • It's a bit later, but this query worked nicely with Tridion Sites 9.6. +1 to the question and answer. :-) Commented Dec 13, 2023 at 20:33
3

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              
        }
      }
    }
  }
}
}
}
1
  • 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
    Commented Feb 4, 2019 at 15:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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