---
keyword: [Extend, PMD Scripting, Scripts, Graph API]
nav: wcp_docs
parent_url: /wcp_docs/
title: >- 
  Example: graph Namespace Functions
layout: subsection
---

This example illustrates how to use the `graph:createId(id)` function in the input variables of a mutation.

Sample mutation that initiates a job change event:

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

Input variables:

```
{
  "input": {
    "date": "2022-12-19",
    "reason": "<% graph:createId('32e3a48dc5f24cd2acb4c5c0e852c08a') %>"
  },
  "workerId": "cc7fb31eecd544e9ae8e03653c63bfab"
}
```

The previous code snippet is equivalent to:

```
{
  "input": {
    "date": "2022-12-19",
    "reason": {
      "id": {
        "id": "32e3a48dc5f24cd2acb4c5c0e852c08a",
        "type": "WID"
      }
    }
  },
  "workerId": "cc7fb31eecd544e9ae8e03653c63bfab"
}
```

### Related Information

[createId(id)](/wcp_docs/GUID-8e532f2e-ee77-4857-b30d-88ac39cfcd6c-enHYPHENus.html)

