#import "ee_else_ce/boards/graphql/issue.fragment.graphql"

query ListIssues(
  $fullPath: ID!
  $boardId: ID!
  $id: ID
  $filters: BoardIssueInput
  $isGroup: Boolean = false
  $isProject: Boolean = false
  $after: String
  $first: Int
) {
  group(fullPath: $fullPath) @include(if: $isGroup) {
    board(id: $boardId) {
      lists(id: $id, issueFilters: $filters) {
        nodes {
          id
          issuesCount
          issues(first: $first, filters: $filters, after: $after) {
            edges {
              node {
                ...IssueNode
              }
            }
            pageInfo {
              endCursor
              hasNextPage
            }
          }
        }
      }
    }
  }
  project(fullPath: $fullPath) @include(if: $isProject) {
    board(id: $boardId) {
      lists(id: $id, issueFilters: $filters) {
        nodes {
          id
          issuesCount
          issues(first: $first, filters: $filters, after: $after) {
            edges {
              node {
                ...IssueNode
              }
            }
            pageInfo {
              endCursor
              hasNextPage
            }
          }
        }
      }
    }
  }
}
