import { gql } from '@apollo/client'

export const GET_RESOURCES = gql`
  query GetResources($filter: ResourceFilter) {
    resources(filter: $filter) {
      id
      name
      type
      status
      site {
        id
        name
        region
      }
      metadata
      createdAt
      updatedAt
    }
  }
`

export const GET_RESOURCE = gql`
  query GetResource($id: ID!) {
    resource(id: $id) {
      id
      name
      type
      status
      site {
        id
        name
        region
      }
      metadata
      createdAt
      updatedAt
    }
  }
`

export const GET_SITES = gql`
  query GetSites {
    sites {
      id
      name
      region
      status
      metadata
      createdAt
      updatedAt
    }
  }
`

export const GET_SITE = gql`
  query GetSite($id: ID!) {
    site(id: $id) {
      id
      name
      region
      status
      resources {
        id
        name
        type
        status
      }
      metadata
      createdAt
      updatedAt
    }
  }
`

export const GET_ME = gql`
  query GetMe {
    me {
      id
      email
      name
      role
      createdAt
      updatedAt
    }
  }
`

export const GET_USERS = gql`
  query GetUsers {
    users {
      id
      email
      name
      role
      createdAt
      updatedAt
    }
  }
`

export const GET_USER = gql`
  query GetUser($id: ID!) {
    user(id: $id) {
      id
      email
      name
      role
      createdAt
      updatedAt
    }
  }
`

