import { gql } from '@apollo/client'

export const GET_TEST_ENVIRONMENTS = gql`
  query GetTestEnvironments {
    testEnvironments {
      id
      name
      region
      status
      resources {
        vms
        storage
        network
      }
      expiresAt
      createdAt
    }
  }
`

export const GET_TEST_ENVIRONMENT = gql`
  query GetTestEnvironment($id: ID!) {
    testEnvironment(id: $id) {
      id
      name
      region
      status
      resources {
        vms
        storage
        network
      }
      expiresAt
      createdAt
    }
  }
`

export const CREATE_TEST_ENVIRONMENT = gql`
  mutation CreateTestEnvironment($input: CreateTestEnvironmentInput!) {
    createTestEnvironment(input: $input) {
      id
      name
      region
      status
      resources {
        vms
        storage
        network
      }
      createdAt
    }
  }
`

export const START_TEST_ENVIRONMENT = gql`
  mutation StartTestEnvironment($id: ID!) {
    startTestEnvironment(id: $id) {
      id
      status
    }
  }
`

export const STOP_TEST_ENVIRONMENT = gql`
  mutation StopTestEnvironment($id: ID!) {
    stopTestEnvironment(id: $id) {
      id
      status
    }
  }
`

export const DELETE_TEST_ENVIRONMENT = gql`
  mutation DeleteTestEnvironment($id: ID!) {
    deleteTestEnvironment(id: $id)
  }
`

