> For the complete documentation index, see [llms.txt](https://docs.inabit.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inabit.com/api-reference/introduction-to-graphql/mutations/example-mutation.md).

# Example Mutation

### GraphQL Mutation: Create Withdrawal

Mutations in GraphQL are operations used to modify data on the server. This example demonstrates how to create a withdrawal request.

#### Operation Name:

The operation is named `CreateWithdrawal`.

#### Operations:

**1. Query to Retrieve Necessary Information:**

```graphql
query GetWalletAndBlockchainID {
  wallet(id: "clol7o576002oaz011mmtnvru") {
    id
  }
  financialAsset(id: "clefn78gv011olc6rcwtt0wel") {
    id
  }
  blockchain(id: "clefn78em00mslc6r3lzf3h5a") {
    id
  }
}
```

This query fetches the IDs of the wallet, financial asset, and blockchain associated with the withdrawal. These IDs are required for creating the withdrawal request.

**2. Mutation to Create Withdrawal:**

```graphql
mutation CreateWithdrawal($data: WithdrawalCreateInput!, $jwtToken: String!) {
  createWithdrawal(data: $data, jwtToken: $jwtToken) {
    id
  }
}
```

#### Variables:

```graphql
{
  "data": {
    "wallet": {
      "id": "clol7o576002oaz011mmtnvru"
    },
    "financialAsset": {
      "id": "clefn78gv011olc6rcwtt0wel"
    },
    "address": "0x7582f3483116105e0b7845ac1a0df5eb0c8cd062",
    "amount": 5,
    "blockchain": {
      "id": "clefn78em00mslc6r3lzf3h5a"
    },
    "note": "",
    "priority": "Medium"
  },
  "jwtToken": "***[accessToken from login response]***"
}
```

#### Explanation:

The process begins with a query to retrieve the IDs of the wallet, financial asset, and blockchain related to the withdrawal. These IDs are then passed as variables along with other necessary details (such as withdrawal amount, destination address, and priority level) to the mutation `CreateWithdrawal`. The mutation creates the withdrawal request using the provided data and the authorization token (`jwtToken`).

#### Response:

Upon successful execution of the mutation, the response contains the ID of the created withdrawal request.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.inabit.com/api-reference/introduction-to-graphql/mutations/example-mutation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
