#import "./epic.fragment.graphql"
#import "./issue.fragment.graphql"

fragment PageInfo on PageInfo {
  endCursor
  hasNextPage
}

query childItems(
  $fullPath: ID!
  $iid: ID
  $pageSize: Int = 100
  $epicEndCursor: String = ""
  $issueEndCursor: String = ""
) {
  group(fullPath: $fullPath) {
    id
    path
    fullPath
    epic(iid: $iid) {
      ...BaseEpic
      children(first: $pageSize, after: $epicEndCursor) {
        edges {
          node {
            ...EpicNode
          }
        }
        pageInfo {
          ...PageInfo
        }
      }
      issues(first: $pageSize, after: $issueEndCursor) {
        edges {
          node {
            ...IssueNode
          }
        }
        pageInfo {
          ...PageInfo
        }
      }
    }
  }
}
