fragment AnomalyAll on Anomaly {
  id
  type
  description
  groupKey
  groupDescription
  sleepTimer
  sleepSince
  solution {
    anomalyId
    id
    name
    steps {
      description
      id
      solutionTargetId
    }
  }
  workedOnBy
  resolvedAt
  createdAt
}

query GetAnomaly($id: String!) {
  anomaly(id: $id) {
    ...AnomalyAll
  }
}

query GetAnomalies($cursor: String, $take: Int!) {
  anomalies(cursor: $cursor, take: $take) {
    prevCursor
    endCursor
    totalCount
    hasNextPage
    nodes {
      ...AnomalyAll
    }
  }
}

query GetGroupedAnomalies($cursor: String, $take: Int!) {
  groupedAnomalies(cursor: $cursor, take: $take) {
    prevCursor
    endCursor
    totalCount
    hasNextPage
    nodes {
      key
      anomalies {
        ...AnomalyAll
      }
    }
  }
}

mutation SetAnomalyToSleep($id: String!) {
  setAnomalyToSleep(id: $id) {
    ...AnomalyAll
  }
}

mutation AcceptAnomaly($id: String!) {
  acceptAnomaly(id: $id) {
    ...AnomalyAll
  }
}
