branchMergePreview

Show the file-by-file changes a merge would apply, with conflict regions and contents. Requires project.read.

Arguments

  • branchIdID!required

    Branch to merge. A missing branch and one the caller cannot read are both not found.

  • targetBranchIdID

    Target branch ID; omit for main.

Responses

query BranchMergePreview($branchId: ID!) {  branchMergePreview(branchId: $branchId) {    sourceBranch {      id      projectId      name      baseBranchId      createdAt      createdBy      mergedAt      mergedBy      updatedAt      version      description      status      autoDeleteOnMerge    }    targetBranchId    targetBranchName    canMerge    blockedReason    hasConflicts    diffs {      filePath      fileType      fileId      hasConflicts      conflictCount      isNew      isDeleted      isModified      baseChanged      branchChanged      baseContent      targetContent      sourceContent    }  }}
{  "data": {    "branchMergePreview": {      "sourceBranch": {        "id": "string",        "projectId": "string",        "name": "string",        "baseBranchId": "string",        "createdAt": "string",        "createdBy": "string",        "mergedAt": "string",        "mergedBy": "string",        "updatedAt": "string",        "version": 0,        "description": "string",        "status": "active",        "autoDeleteOnMerge": false      },      "targetBranchId": "string",      "targetBranchName": "string",      "canMerge": false,      "blockedReason": "string",      "hasConflicts": false,      "diffs": [        {          "filePath": "string",          "fileType": "string",          "fileId": "string",          "hasConflicts": false,          "conflictCount": 0,          "isNew": false,          "isDeleted": false,          "isModified": false,          "baseChanged": false,          "branchChanged": false,          "baseContent": "string",          "targetContent": "string",          "sourceContent": "string"        }      ]    }  }}

The BranchMergePreview! in data.branchMergePreview.