#import "~/graphql_shared/fragments/pageInfo.fragment.graphql"
#import "./iteration_list_item.fragment.graphql"

query Iterations(
  $fullPath: ID!
  $isGroup: Boolean = true
  $state: IterationState!
  $beforeCursor: String = ""
  $afterCursor: String = ""
  $firstPageSize: Int
  $lastPageSize: Int
) {
  group(fullPath: $fullPath) @include(if: $isGroup) {
    iterations(
      state: $state
      before: $beforeCursor
      after: $afterCursor
      first: $firstPageSize
      last: $lastPageSize
    ) {
      nodes {
        ...IterationListItem
      }
      pageInfo {
        ...PageInfo
      }
    }
  }
  project(fullPath: $fullPath) @skip(if: $isGroup) {
    iterations(
      state: $state
      before: $beforeCursor
      after: $afterCursor
      first: $firstPageSize
      last: $lastPageSize
    ) {
      nodes {
        ...IterationListItem
      }
      pageInfo {
        ...PageInfo
      }
    }
  }
}
