query getState($projectPath: ID!, $iid: String!) {
  project(fullPath: $projectPath) {
    archived
    onlyAllowMergeIfPipelineSucceeds

    mergeRequest(iid: $iid) {
      autoMergeEnabled
      commitCount
      conflicts
      diffHeadSha
      mergeError
      mergeStatus
      mergeableDiscussionsState
      headPipeline {
        id
        status
        warnings
      }
      shouldBeRebased
      sourceBranchExists
      state
      targetBranchExists
      userPermissions {
        canMerge
      }
      workInProgress
    }
  }
}
