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

# Publish release

> Merge dev into main and tag a release with the `publish` GraphQL mutation.

Use the `publish` mutation to merge a project's `dev` branch into `main` and tag the result as a release version. You can then [deploy the release](https://docs.prophecy.ai/api-reference/projects/deploy-project.md) to a fabric or [run a pipeline](https://docs.prophecy.ai/api-reference/pipelines/trigger-pipeline-run.md) from it.

```
POST /api/md/graphql
```

The release is tagged `{projectName}/{version}`, for example `sales_reporting/0.1.0`. Use this tag as the `gitTag` value when you deploy the release.

## Arguments

**uid** `string` *required*

ID of the project to publish, as returned in `data.addProject._id` when you [create the
project](https://docs.prophecy.ai/api-reference/projects/create-project.md).

**releaseVersion** `string` *required*

New version number, for example `0.1.0`. Each release needs a new version.

**releaseNotes** `string` *required*

Short description of the release.

## Response

**data.publish.merged** `string`

Outcome of the merge, for example `Success`.

**data.publish.fromBranch** `string`

Branch that was merged, for example `dev`.

**data.publish.toBranch** `string`

Branch that was merged into, for example `main`.

```bash cURL theme={null}
QUERY=$(tr '\n' ' ' <<'EOF'
mutation($p: String!, $version: String!, $notes: String!) {
  publish(uid: $p, releaseVersion: $version, releaseNotes: $notes) {
    merged fromBranch toBranch
  }
}
EOF
)
VARS='{"p": "<PROJECT_ID>", "version": "<VERSION>", "notes": "<RELEASE_NOTES>"}'
curl -sS "$PROPHECY_URL/api/md/graphql" \
  -H "X-Auth-Token: $PROPHECY_TOKEN" -H "Content-Type: application/json" \
  -d "$(printf '{"query": "%s", "variables": %s}' "$QUERY" "$VARS")"
```

```json Response theme={null}
{
  "data": {
    "publish": {
      "merged": "Success",
      "fromBranch": "dev",
      "toBranch": "main"
    }
  }
}
```


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