Answered

What are the differences between the fields id, itemID, and contentID for a content item?

What are the differences between the fields id, itemID, and contentID for a content item?

I am trying to figure out which one to use as the "key" field in an <li> element for my React site (https://reactjs.org/docs/lists-and-keys.html#keys) and do not know which is best suited for this. When I run a GraphQL query for the content that I want to put into a list, this is the result I get for those three fields:

"id": "5806be84-7e49-59e8-8f61-73ed1d8b0b99"
"itemID": 62
"contentID": 62

1

Comments

2 comments
  • Official comment

    The "id" field is assigned by Gatsby.  Agility uses the itemID field internally to manage the sync state of an item.

    For your own purposes, use contentID - that will always correspond to the contentID in Agility CMS that you expect to see.  

    Comment actions Permalink
  • Thanks!

    0
    Comment actions Permalink

Please sign in to leave a comment.

Didn't find what you were looking for?

New post