> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stigg.io/llms.txt
> Use this file to discover all available pages before exploring further.

# mergeEnvironmentAsync

> Enqueue an async environment merge-apply job (STIGG-7830) and return a status handle immediately.



**mutation** `mergeEnvironmentAsync(input: MergeEnvironmentInput!): MergeApplyStatus!`

## Arguments

**`input`**: `MergeEnvironmentInput!` (required)

## Returns

`MergeApplyStatus!`

**`destinationEnvironmentSlug`**: `String`

Destination environment slug the apply targets. Populated for "copy to new environment" so the client can navigate to / poll the newly created environment.

---

**`error`**: `String`

Failure message when the apply job failed.

---

**`publishedTaskIds`**: `[String!]!`

Publish task ids produced by the per-plan / per-addon publish side-effects.

---

**`state`**: `MergeApplyState!`

Current lifecycle state of the apply job.

---

**`taskId`**: `String!`

The merge-apply job/task id; poll this for status.

## Examples

```graphql Mutation
mutation MergeEnvironmentAsync($input: MergeEnvironmentInput!) {
  mergeEnvironmentAsync(input: $input) {
    destinationEnvironmentSlug
    error
    publishedTaskIds
    state
    taskId
  }
}
```

```json Variables
{
  "input": {}
}
```

```json Response
{
  "data": {
    "mergeEnvironmentAsync": {
      "destinationEnvironmentSlug": "string",
      "error": "string",
      "publishedTaskIds": [
        "string"
      ],
      "state": "COMPLETED",
      "taskId": "string"
    }
  }
}
```


## Related topics

- [MergePreviewStatus](https://docs.stigg.io/graphql-reference/types/MergePreviewStatus.md)
- [MergePreviewState](https://docs.stigg.io/graphql-reference/types/MergePreviewState.md)
- [mergePreviewStatus](https://docs.stigg.io/graphql-reference/queries/mergePreviewStatus.md)
- [MergeApplyState](https://docs.stigg.io/graphql-reference/types/MergeApplyState.md)
- [mergeApplyStatus](https://docs.stigg.io/graphql-reference/queries/mergeApplyStatus.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.