Which of the following GraphQL mutations is the correct way to create a new item?

A developer is tasked with creating an item using the Sitecore Authoring and Management GraphQL API.

Which of the following GraphQL mutations is the correct way to create a new item?
A . createOrUpdateltem
B . create Templateltem
C . createltem
D . updateltem

Answer: C

Explanation:

The correct GraphQL mutation to create a new item in Sitecore XM Cloud is createItem. This mutation allows developers to specify the necessary details such as the item’s name, template ID, parent ID, language, and fields to create a new content item within the Sitecore content tree.

Reference: The usage of the createItem mutation is documented in the Sitecore XM Cloud Developer’s Guide, which provides examples and explanations for authoring operations, including item creation1. Additionally, the Sitecore Stack Exchange provides insights into the available mutations for item management, confirming the use of createItem for creating new items2.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments