Skip to main content

Enums

AssetType

enum AssetType {
  PIPELINE
  SEGMENT
  TEST_STATION
  RECTIFIER
  EQUIPMENT
  ANODE_BED
}

EventSeverity

enum EventSeverity {
  INFO
  WARNING
  CRITICAL
}

QualityFlag

enum QualityFlag {
  GOOD
  SUSPECT
  BAD
}

MeasurementSource

enum MeasurementSource {
  MANUAL
  AUTOMATED
  IMPORT
  CALCULATED
}

WorkOrderStatus

enum WorkOrderStatus {
  PENDING
  ASSIGNED
  IN_PROGRESS
  COMPLETED
  CANCELLED
}

FailureType

enum FailureType {
  COMPLETE
  DEGRADED
  INTERMITTENT
}

ConflictResolution

enum ConflictResolution {
  SKIP
  UPDATE
  CREATE_NEW
}

Object Types

Asset

type Asset {
  id: UUID!
  tenantId: UUID!
  name: String!
  assetType: AssetType!
  externalId: String
  parentId: UUID
  geometry: GeoJSON
  attributes: JSON
  createdAt: DateTime!
  updatedAt: DateTime!

  # Relationships
  parent: Asset
  children: [Asset!]!
  measurements(limit: Int): [Measurement!]!
  events(limit: Int): [Event!]!
  riskScore: Float
}

Measurement

type Measurement {
  id: UUID!
  assetId: UUID!
  assetType: AssetType!
  measurementType: String!
  value: Float!
  unit: String!
  recordedAt: DateTime!
  recordedBy: UUID
  source: MeasurementSource!
  quality: QualityFlag!
  metadata: JSON

  # Relationships
  asset: Asset!
}

Event

type Event {
  id: UUID!
  assetId: UUID!
  eventType: String!
  severity: EventSeverity!
  title: String!
  description: String
  occurredAt: DateTime!
  resolvedAt: DateTime
  acknowledgedAt: DateTime
  acknowledgedBy: UUID
  metadata: JSON

  # Relationships
  asset: Asset!
}

Pipeline

type Pipeline {
  id: UUID!
  name: String!
  operator: String
  productType: String
  geometry: GeoJSON
  attributes: JSON

  # Relationships
  segments: [Segment!]!
  totalMiles: Float
  riskScore: Float
}

Segment

type Segment {
  id: UUID!
  pipelineId: UUID!
  name: String!
  startMilePost: Float
  endMilePost: Float
  diameterInches: Float
  wallThickness: Float
  material: String
  coatingType: String
  installDate: Date
  geometry: GeoJSON

  # Relationships
  pipeline: Pipeline!
  testStations: [TestStation!]!
  rectifiers: [Rectifier!]!
  riskScore: Float
}

TestStation

type TestStation {
  id: UUID!
  segmentId: UUID!
  name: String!
  stationType: String
  milePost: Float
  geometry: GeoJSON

  # Relationships
  segment: Segment!
  lastReading: Measurement
  readings(limit: Int): [Measurement!]!
}

Rectifier

type Rectifier {
  id: UUID!
  segmentId: UUID!
  name: String!
  manufacturer: String
  model: String
  ratedOutputAmps: Float
  ratedOutputVolts: Float
  installDate: Date
  geometry: GeoJSON

  # Current readings
  currentOutput: Float
  voltageOutput: Float
  status: String

  # Relationships
  segment: Segment!
  protectedSegments: [Segment!]!
}

PipelineSummary

type PipelineSummary {
  totalAssets: Int!
  totalPipelines: Int!
  totalSegments: Int!
  totalTestStations: Int!
  totalRectifiers: Int!
  assetsByType: [AssetCount!]!
  recentEvents: [Event!]!
  measurementStats: [MeasurementStats!]!
}

ImpactAnalysis

type ImpactAnalysis {
  affectedAssets: [AffectedAsset!]!
  totalAffectedSegments: Int!
  totalAffectedMiles: Float!
  estimatedRepairTime: String
  recommendations: [String!]!
}

RelationshipGraph

type RelationshipGraph {
  nodes: [GraphNode!]!
  edges: [GraphEdge!]!
}

type GraphNode {
  id: UUID!
  name: String!
  assetType: AssetType!
  riskScore: Float
}

type GraphEdge {
  source: UUID!
  target: UUID!
  relationshipType: String!
}

Input Types

CreateAssetInput

input CreateAssetInput {
  name: String!
  assetType: AssetType!
  externalId: String
  parentId: UUID
  segmentId: UUID
  geometry: GeoJSONInput
  attributes: JSON
}

UpdateAssetInput

input UpdateAssetInput {
  name: String
  externalId: String
  geometry: GeoJSONInput
  attributes: JSON
}

RecordMeasurementInput

input RecordMeasurementInput {
  assetId: UUID!
  measurementType: String!
  value: Float!
  unit: String!
  recordedAt: DateTime
  source: MeasurementSource
  quality: QualityFlag
  metadata: JSON
}

CreateEventInput

input CreateEventInput {
  assetId: UUID!
  eventType: String!
  severity: EventSeverity!
  title: String!
  description: String
  occurredAt: DateTime
  metadata: JSON
}

StartImportInput

input StartImportInput {
  sourceType: ImportSourceType!
  sourceUrl: String
  fileId: UUID
  targetAssetType: AssetType!
  fieldMapping: JSON!
  conflictResolution: ConflictResolution!
  syncSchedule: String
}

Scalar Types

# Universally unique identifier
scalar UUID

# ISO 8601 date-time string
scalar DateTime

# ISO 8601 date string
scalar Date

# Arbitrary JSON object
scalar JSON

# GeoJSON geometry object
scalar GeoJSON

GeoJSON Examples

Point:
{
  "type": "Point",
  "coordinates": [-97.123, 32.456]
}
LineString:
{
  "type": "LineString",
  "coordinates": [
    [-97.123, 32.456],
    [-97.234, 32.567],
    [-97.345, 32.678]
  ]
}