#import "./milestone.fragment.graphql"

query searchMilestones($fullPath: ID!, $search: String, $isProject: Boolean = false) {
  group(fullPath: $fullPath) @skip(if: $isProject) {
    milestones(searchTitle: $search, includeAncestors: true, includeDescendants: true) {
      nodes {
        ...Milestone
      }
    }
  }
  project(fullPath: $fullPath) @include(if: $isProject) {
    milestones(searchTitle: $search, includeAncestors: true) {
      nodes {
        ...Milestone
      }
    }
  }
}
