- Complete project structure with Next.js frontend - GraphQL API backend with Apollo Server - Portal application with NextAuth - Crossplane Proxmox provider - GitOps configurations - CI/CD pipelines - Testing infrastructure (Vitest, Jest, Go tests) - Error handling and monitoring - Security hardening - UI component library - Documentation
105 lines
1.5 KiB
TypeScript
105 lines
1.5 KiB
TypeScript
import { gql } from '@apollo/client'
|
|
|
|
// Query for getting all regions
|
|
export const GET_REGIONS = gql`
|
|
query GetRegions {
|
|
regions {
|
|
id
|
|
name
|
|
code
|
|
country
|
|
coordinates {
|
|
latitude
|
|
longitude
|
|
}
|
|
sites {
|
|
id
|
|
name
|
|
}
|
|
clusters {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
// Query for getting a specific region
|
|
export const GET_REGION = gql`
|
|
query GetRegion($id: ID!) {
|
|
region(id: $id) {
|
|
id
|
|
name
|
|
code
|
|
country
|
|
coordinates {
|
|
latitude
|
|
longitude
|
|
}
|
|
sites {
|
|
id
|
|
name
|
|
clusters {
|
|
id
|
|
name
|
|
}
|
|
}
|
|
clusters {
|
|
id
|
|
name
|
|
nodes {
|
|
id
|
|
name
|
|
health
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|
|
// Query for getting resources
|
|
export const GET_RESOURCES = gql`
|
|
query GetResources($filter: ResourceFilter) {
|
|
resources(filter: $filter) {
|
|
id
|
|
name
|
|
type
|
|
region {
|
|
id
|
|
name
|
|
}
|
|
health
|
|
metadata
|
|
}
|
|
}
|
|
`
|
|
|
|
// Query for getting network topology
|
|
export const GET_NETWORK_TOPOLOGY = gql`
|
|
query GetNetworkTopology($regionId: ID) {
|
|
networkTopology(regionId: $regionId) {
|
|
nodes {
|
|
id
|
|
name
|
|
type
|
|
position {
|
|
x
|
|
y
|
|
z
|
|
}
|
|
health
|
|
}
|
|
edges {
|
|
id
|
|
from
|
|
to
|
|
type
|
|
latency
|
|
bandwidth
|
|
status
|
|
}
|
|
}
|
|
}
|
|
`
|
|
|