---
keyword: [Extend, Workday Graph API, Graph API, GraphQL]
nav: wcp_docs
parent_url: /wcp_docs/
title: Sample Mutations
layout: subsection
---

## <a id="section_ntd_wv5_stb"></a>Change a Business Title

This example uses the Job Changes mutations that:

-   Initiate a job change event.
-   Update the business title.
-   Submit the job change event.


The series of mutations illustrate a shopping cart pattern, which enables you to update other job change data before submitting the job change event.

```
mutation initiateJobChangeEvent($input: Staffing_JobChangesStartDetailsPOSTData_CreateInput!, $workerId: ID!) {
 initiateWorkerJobChange(input: $input, workerId: {id: $workerId}) {
   date
   workdayID {
      id
      type
   }
 }
}
 
```

Input variables:

```
{
 "input": {
   "date": "2023-02-09",
   "reason": {
     "id": {
       "id": "32e3a48dc5f24cd2acb4c5c0e852c08a",
       "type": "WID"
     }
   }
 },
 "workerId": "cc7fb31eecd544e9ae8e03653c63bfab"
}
```

This sample response returns the job change event ID, which becomes the input id for the next mutations.

```
{
"data": {
 "initiateWorkerJobChange": {
   "date": "2022-12-19",
   "workdayID": {
     "id": "d5f07ec4595310001fb832ed1af30000",
     "type": "WID"
   }
 }
}
}
```

This next mutation updates the business title. The <i>jobChangeId</i> query variable uses the returned `id` from the `initiateWorkerJobChange` mutation.

```
mutation updateBusinessTitle($jobChangeId: ID!, $businessTitle:  String) {
 updateJobChangeBusinessTitle(
   businessTitleId: {id: $jobChangeId}
   input: {businessTitle: $businessTitle}
   jobChangeId: {id: $jobChangeId}
 ) {
   businessTitle
 }
}
 
```

Input variables:

```
{
  "jobChangeId": "d5f07ec4595310001fb832ed1af30000",
  "businessTitle": "Sr Director 1"
}
```

Sample response:

```
{
  "data": {
   "updateJobChangeBusinessTitle": {
     "businessTitle": "Sr Director 1"
   }
  }
}
```

This last mutation submits the job change event:

```
mutation submitJobChange($jobChangeId: ID!) {
 submitJobChange(
   input: {}
   jobChangeId: {id: $jobChangeId}
 ) {
   workdayID {
     id
   }
 }
}
```

Input variable:

```
{
  "jobChangeId": "d5f07ec4595310001fb832ed1af30000"
}
```

Sample response:

```
{
  "data": {
   "submitJobChange": {
     "workdayID": {
       "id": "d5f07ec4595310001fb832ed1af30000"
     }
   }
  }
}
```

## <a id="section_wbx_q1t_wvb"></a>Create a Requisition

This example uses the `createProcurementRequisition` mutation with input data in the <i>$createProcurementRequisition_input</i> variable.

```
mutation createProcurementRequisition($createProcurementRequisition_input: Procurement_CreateRequisitionRepresentation_CreateInput!) {
 createProcurementRequisition(input: $createProcurementRequisition_input) {
   descriptor
   workdayID {
     id
   }
   memo
   company {
     descriptor
   }
   requester {
     descriptor
   }
   requisitionLines {
     descriptor
     workdayID {
       id
     }
     itemDescription
   }
 }
}
```

Input variables

```
{
 "createProcurementRequisition_input": {
   "requester": {
     "id": {
       "id": "3aa5550b7fe348b98d7b5741afc65534",
       "type": "WID"
     }
   },
   "memo": "Mobile gadget request for project 1",
   "requisitionLines": [
     {
       "item": {
         "id": {
         "id": "c81b4811f29e4014bb5321b57b8e1f31",
           "type": "WID"
           }
       },
       "quantity": 5
     }
   ]
 }
}
```

Sample response:

```
{
"data": {
 "createProcurementRequisition": {
   "descriptor": "REQ-7173",
   "workdayID": {
     "id": "2284d41d169f9000214cee69d1540000"
   },
   "memo": "Mobile gadget request for project 1",
   "company": {
     "descriptor": "Global Modern Services, Inc. (USA)"
   },
   "requester": {
     "descriptor": "Logan McNeil"
   },
   "requisitionLines": [
     {
       "descriptor": "REQ-7173",
       "workdayID": {
         "id": "2284d41d169f9000214cefc01dca0000"
       },
       "itemDescription": "iPad 2 64GB"
     }
   ]
 }
}
}
```

## <a id="section_qtw_lfx_15b"></a>Create an Expense Report

This example uses the `createExpenseReport` mutation with input data in the <i>$createExpenseReport_input</i> variable.

```
mutation createExpenseReport($createExpenseReport_input: Expense_ReportPostServiceRepresentation_CreateInput!) {
 createExpenseReport(input: $createExpenseReport_input) {
   descriptor
   expenseReportMemo
   workdayID {
     id
   }
 }
}
```

The `input` variable:

```
{
  "createExpenseReport_input": {
    "expenseReportMemo": "Group test lunch",
    "creationDate": "2023-03-20"
  }
}
```

Sample response:

```
{
"data": {
 "createExpenseReport": {
   "descriptor": "Expense Report: EXP-00009600",
   "expenseReportMemo": "Group test lunch",
   "workdayID": {
     "id": "2284d41d169f9000216e8d28df700000"
   }
 }
}
}
```

## <a id="section_1"></a>Create a Quick Expense with Attachments

This example uses the `createQuickExpense` mutation with input data in the <i>$createQuickExpense_input</i> variable. 

```
mutation myApp_createLogosCollection(
 $myApp_createLogosCollection_input: MyApp_LogosCollection_CreateInput!
) {
 myApp_createLogosCollection(input: $myApp_createLogosCollection_input) {
   logos {
     workdayID {
       id
     }
   }
 }
}
```

In this input variable, the attachments[] list contains the attachment part names, which must correspond to the multipart form names containing the file attachments.

```
{
"createQuickExpense_input": {
  "attachments":  [
      {
        "attachmentContent": "file1"
      },
      {
        "attachmentContent": "file2"
      }
  ],
  "date": "2024-10-04",
  "expenseItem": {
    "id": {
      "id": "Miscellaneous",
      "type": "Expense_Item_ID"
    }
  },
  "amount": {
    "currency": "USD",
    "value": 200.00
  },
  "memo": "group lunch",
  "merchant": "Data Diner"
}
}
```

Sample response:

```
{
"data": {
 "createQuickExpense": {
   "workdayID": {
     "id": "c1c505fcf6110100245cb60433080000"
   }
 }
}
}
 
```

## <a id="section_3"></a>Create Model Attachments

This example uses the `createQuickExpense` mutation with input data in the <i>$createQuickExpense_input</i> variable. 

This example creates Logo attachments, which are model attachments in an Extend app.

```
mutation myApp_createLogosCollection(
 $myApp_createLogosCollection_input: MyApp_LogosCollection_CreateInput!
) {
 myApp_createLogosCollection(input: $myApp_createLogosCollection_input) {
   logos {
     workdayID {
       id
     }
   }
 }
}
```

In this input variable, the logos[] list contains the `attachmentContent` fields with the part names, which must correspond to the multipart form names containing the file attachments.

```
{
"myApp_createLogosCollection_input": {
  "logos": [
    {
      "attachmentContent": "file0",
      "uploadedBy": {
        "id": {
          "id": "21001",
          "type": "Employee_ID"
        }
      },
      "uploadedDate": "2024-10-14"
    },
    {
      "attachmentContent": "file1",
      "uploadedBy": {
        "id": {
          "id": "21001",
          "type": "Employee_ID"
        }
      },
      "uploadedDate": "2024-10-14"
    }      
  ]
}
}
 
```

Sample response:

```
{
"data": {
  "myApp_createLogosCollection": {
    "logos": [
      {
        "workdayID": {
          "id": "15ced8c3457481001cd2e54740d20000"
        }
      },
      {
        "workdayID": {
          "id": "15ced8c3457481001cd2e4135aa40001"
        }
      }
    ]
  }
}
}
 
```

## <a id="section_gmf_qfx_15b"></a>Give Performance Feedback

This sample mutation uses the `initiateWorkerFeedback` mutation with input data in the <i>$initiateWorkerFeedback_input</i> variable. The feedback is for the specified worker ID in the <i>$initiateWorkerFeedback_workerId</i> variable.

```
mutation initiateTheWorkerFeedback($initiateWorkerFeedback_input: PerformanceEnablement_GiveFeedbackDetail_CreateInput!, $initiateWorkerFeedback_workerId: IdentifierInput!) {
 initiateWorkerFeedback(
   input: $initiateWorkerFeedback_input
   workerId: $initiateWorkerFeedback_workerId
 ) {
   badge {
     descriptor
     workdayID {
       id
     }
   }
   comment
   feedbackGiven {
     descriptor
     workdayID {
       id
     }
   }
   feedbackGivenDate
 }
}
```

Input variables:

```
{
 "initiateWorkerFeedback_input": {
   "comment": "Thanks for all the hard work and collaboration!",
   "badge": {
     "id": {
       "id": "266d32856b2f1070d37c87dfb88a0067",
       "type": "WID"
     }
   }
 },
 "initiateWorkerFeedback_workerId": {
   "id": "cc7fb31eecd544e9ae8e03653c63bfab",
   "type": "WID"
 }
}
```

Sample response:

```
{
"data": {
 "initiateWorkerFeedback": {
   "badge": {
     "descriptor": "Teamwork",
     "workdayID": {
       "id": "266d32856b2f1070d37c87dfb88a0067"
     }
   },
   "comment": "Thanks for all the hard work and collaboration!",
   "feedbackGiven": [
     {
       "descriptor": "Anytime Feedback Given: on Maria Cardoza from Logan McNeil on 03/20/2023",
       "workdayID": {
         "id": "2284d41d169f100021979c8c54f90000"
       }
     }
   ],
   "feedbackGivenDate": "2023-03-21T00:20:46.000Z"
 }
}
}
```

## <a id="section_lcm_5dt_wvb"></a>Request a One-Time Payment

This sample mutation uses the `requestOneTimePayment` mutation with input data in the <i>$requestOneTimePayment_input</i> variable. The feedback is for the specified worker ID in the <i>$requestOneTimePayment_workerId</i> variable.

```
mutation requestFeedbackOneTimePayment(
 $requestOneTimePayment_input: Compensation_OneTimePaymentPlanEventInput_CreateInput!
 $requestOneTimePayment_workerId: IdentifierInput!
) {
 requestOneTimePayment(
   input: $requestOneTimePayment_input
   workerId: $requestOneTimePayment_workerId
 ) {
   descriptor
   effectiveDate
   workdayID {
     id
   }
   oneTimePayments {
     additionalInformation
     descriptor
     workdayID {
       id
     }
     oneTimePaymentPlan {
       descriptor
     }
   }
 }
}
```

Input variables:

```
{
 "requestOneTimePayment_input": {
   "effectiveDate": "2022-12-19",
   "oneTimePayments": [
     {
       "oneTimePaymentPlan": {
         "id": {
           "id": "27e0426346184fcc93e11ff21bcce203",
           "type": "WID"
         }
       },
       "additionalInformation": "Thanks again!",
       "paymentAmount": {
         "value": 100,
         "currency": "USD"
       }
     }
   ]
 },
 "requestOneTimePayment_workerId": {
   "id": "cc7fb31eecd544e9ae8e03653c63bfab",
   "type": "WID"
 }
}
```

Sample response:

```
{
"data": {
 "requestOneTimePayment": {
   "descriptor": "One-Time Payment: Maria Cardoza - P-00011 Director, Employee Benefits",
   "effectiveDate": "2022-12-19",
   "workdayID": {
     "id": "2284d41d169f100021beac538c1e0000"
   },
   "oneTimePayments": [
     {
       "additionalInformation": "Thanks again!",
       "descriptor": "Gift Card: 100 USD (12/19/2022)",
       "workdayID": {
         "id": "2284d41d169f100021beaced190c0000"
       },
       "oneTimePaymentPlan": {
         "descriptor": "Gift Card"
       }
     }
   ]
 }
}
}
```

## <a id="section_c24_c5l_fwb"></a>Create a Tuition Reimbursement (Model Business Object)

This mutation creates a course object, which is a model business object that has a `SINGLE_INSTANCE` relationship to the <i>tuitionReimbursementRequest</i> parent request.

```
mutation tuitionReimbursementbasicbp_sghrnq_createTuitionReimbursementCourse($tuitionReimbursementbasicbp_sghrnq_createTuitionReimbursementCourse_input: TuitionReimbursementbasicbp_sghrnq_TuitionReimbursementCoursesSummaryInput!) {
tuitionReimbursementbasicbp_sghrnq_createTuitionReimbursementCourse(
 input: $tuitionReimbursementbasicbp_sghrnq_createTuitionReimbursementCourse_input
) {
 courseCost
 courseCostCurrency
 courseEndDate
 courseName
 courseStartDate
 courseSubtotal
 courseSubtotalCurrency
 descriptor
 id {
   id
   type
 }
 school
 textbookCost
 textbookCostCurrency
 tuitionReimbursementRequest {
   id {
     id
   }
 }
}
}
```

Input variables, which include the <i>tuitionReimbursementRequest</i> instance linked to the new course:

```
{
"tuitionReimbursementbasicbp_sghrnq_createTuitionReimbursementCourse_input": {
 "courseCost":123.45,
 "courseCostCurrency":"USD",
 "courseEndDate":"2023-12-31",
 "courseName":"ABC",
 "courseStartDate":"2023-12-01",
 "courseSubtotal":99,
 "courseSubtotalCurrency":"USD",
 "school":"USU",
 "textbookCost":123,
 "textbookCostCurrency":"",
 "tuitionReimbursementRequest": {
   "id": {
     "id":"0c1fc0f7dba38107937fbdfca0350000",
     "type": "WID"
   }
 }
}}
```

## <a id="section_2"></a>Create Model Attachments

This sample mutation creates <i>Logo</i> attachments, used as model attachments in an Extend app. The <i>logos[ ]</i> list contains the `attachmentContent` fields with the part names, which correspond to the part names containing the file attachments.

```
mutation myApp_createLogosCollection($myApp_createLogosCollection_input: MyApp_LogosCollection_CreateInput!) {
myApp_createLogosCollection(
  input: $myApp_createLogosCollection_input
) {
  logos {
    workdayID {
      id
    }
  }
}
}
 
```

Input variables:

```
{
"myApp_createLogosCollection_input": {
  "logos": [
    {
      "attachmentContent": "file0",
      "uploadedBy": {
        "id": {
          "id": "21001",
          "type": "Employee_ID"
        }
      },
      "uploadedDate": "2024-10-14"
    },
    {
      "attachmentContent": "file1",
      "uploadedBy": {
        "id": {
          "id": "21001",
          "type": "Employee_ID"
        }
      },
      "uploadedDate": "2024-10-14"
    }      
  ]
}
}
 
```

Sample response:

```
{
"data": {
  "myApp_createLogosCollection": {
    "logos": [
      {
        "workdayID": {
          "id": "15ced8c3457481001cd2e54740d20000"
        }
      },
      {
        "workdayID": {
          "id": "15ced8c3457481001cd2e4135aa40001"
        }
      }
    ]
  }
}
}
```

### Related Information

[Graph API Queries](/wcp_docs/qxq1671067079349.html)

