SITECORE-XM-CLOUD-DEVELOPER practice question 2 of 10
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?
Full set: 49 questionsThe Sitecore Authoring and Management GraphQL API provides a specific set of mutations for content manipulation. To create a new item, the designated mutation is createItem. This mutation requires arguments such as name, templateId, and parentId to define the new item's basic properties and its location within the content tree. The API is designed with explicit, single-purpose mutations for clarity and control over authoring operations, distinguishing creation from updates or other actions.
A. createOrUpdateItem: This mutation does not exist in the Sitecore Authoring and Management GraphQL API. The API separates create and update operations into distinct createItem and updateItem mutations.
B. createTemplateItem: This is not a valid mutation. To create an item based on a specific template (including creating a new template definition item), the standard createItem mutation is used with the appropriate templateId.
D. updateItem: This mutation is used exclusively for modifying the fields of an existing item. It cannot be used to create a new item; its purpose is to update, not to insert.
1. Sitecore XM Cloud Documentation, createItem: This official document explicitly defines the createItem mutation. It states, "The createItem mutation creates a new item." It also details the required arguments (name, parentId, templateId) and the return type.
Reference: Sitecore XM Cloud Documentation > GraphQL API > Authoring and Management API > Mutations > createItem.
2. Sitecore XM Cloud Documentation, The Authoring and Management GraphQL API: This overview page lists the available mutations for the API. The list includes createItem, updateItem, and deleteItem, but does not include createOrUpdateItem or createTemplateItem, confirming they are not valid operations.
Reference: Sitecore XM Cloud Documentation > GraphQL API > Authoring and Management API. (Section on "Mutations").
Keep practicing
Take the free SITECORE-XM-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other SITECORE-XM-CLOUD-DEVELOPER practice questions
- Question 1Which of the following needs to happen for a developer to be able to log in into the XM C…
- Question 3What does the default scope for a serialization include if the scope parameter is not def…
- Question 4Which of the following must be done to delete or remove a user from an administrator role?
- Question 5A developer is working with Sitecore's Authoring and Management API to manage their Sitec…
- Question 6How can a developer differentiate between XM Cloud Components and Headless SXA Components?
- Question 7In the content tree, an administrator-level user cannot see the Layouts or Templates node…
