#import "./DeploymentGroupInfo.gql"
#import "./ServiceInfo.gql"

query Services(
  $deploymentGroupSlug: String!
  $metricNames: [MetricName]!
  $start: String!
  $end: String!
) {
  deploymentGroup(slug: $deploymentGroupSlug) {
    ...DeploymentGroupInfo
    services {
      ...ServiceInfo
      branches {
        id
        name
        slug
        instances {
          id
          status
          healthy
          metrics(names: $metricNames, start: $start, end: $end) {
            instance
            name
            start
            end
            metrics {
              time
              value
            }
          }
        }
      }
      connections
      instances {
        id
        status
        healthy
        metrics(names: $metricNames, start: $start, end: $end) {
          instance
          name
          start
          end
          metrics {
            time
            value
          }
        }
      }
    }
  }
}
