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

    mergeRequest(iid: $iid) {
      autoMergeEnabled
      commitCount
      conflicts
      diffHeadSha
      mergeError
      mergeStatus
      mergeableDiscussionsState
      pipelines(first: 1) {
        nodes {
          status
        }
      }
      shouldBeRebased
      sourceBranchExists
      state
      targetBranchExists
      userPermissions {
        canMerge
      }
      workInProgress
    }
  }
}
