Enums
AssetType
Copy
enum AssetType {
PIPELINE
SEGMENT
TEST_STATION
RECTIFIER
EQUIPMENT
ANODE_BED
}
EventSeverity
Copy
enum EventSeverity {
INFO
WARNING
CRITICAL
}
QualityFlag
Copy
enum QualityFlag {
GOOD
SUSPECT
BAD
}
MeasurementSource
Copy
enum MeasurementSource {
MANUAL
AUTOMATED
IMPORT
CALCULATED
}
WorkOrderStatus
Copy
enum WorkOrderStatus {
PENDING
ASSIGNED
IN_PROGRESS
COMPLETED
CANCELLED
}
FailureType
Copy
enum FailureType {
COMPLETE
DEGRADED
INTERMITTENT
}
ConflictResolution
Copy
enum ConflictResolution {
SKIP
UPDATE
CREATE_NEW
}
Object Types
Asset
Copy
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
Copy
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
Copy
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
Copy
type Pipeline {
id: UUID!
name: String!
operator: String
productType: String
geometry: GeoJSON
attributes: JSON
# Relationships
segments: [Segment!]!
totalMiles: Float
riskScore: Float
}
Segment
Copy
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
Copy
type TestStation {
id: UUID!
segmentId: UUID!
name: String!
stationType: String
milePost: Float
geometry: GeoJSON
# Relationships
segment: Segment!
lastReading: Measurement
readings(limit: Int): [Measurement!]!
}
Rectifier
Copy
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
Copy
type PipelineSummary {
totalAssets: Int!
totalPipelines: Int!
totalSegments: Int!
totalTestStations: Int!
totalRectifiers: Int!
assetsByType: [AssetCount!]!
recentEvents: [Event!]!
measurementStats: [MeasurementStats!]!
}
ImpactAnalysis
Copy
type ImpactAnalysis {
affectedAssets: [AffectedAsset!]!
totalAffectedSegments: Int!
totalAffectedMiles: Float!
estimatedRepairTime: String
recommendations: [String!]!
}
RelationshipGraph
Copy
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
Copy
input CreateAssetInput {
name: String!
assetType: AssetType!
externalId: String
parentId: UUID
segmentId: UUID
geometry: GeoJSONInput
attributes: JSON
}
UpdateAssetInput
Copy
input UpdateAssetInput {
name: String
externalId: String
geometry: GeoJSONInput
attributes: JSON
}
RecordMeasurementInput
Copy
input RecordMeasurementInput {
assetId: UUID!
measurementType: String!
value: Float!
unit: String!
recordedAt: DateTime
source: MeasurementSource
quality: QualityFlag
metadata: JSON
}
CreateEventInput
Copy
input CreateEventInput {
assetId: UUID!
eventType: String!
severity: EventSeverity!
title: String!
description: String
occurredAt: DateTime
metadata: JSON
}
StartImportInput
Copy
input StartImportInput {
sourceType: ImportSourceType!
sourceUrl: String
fileId: UUID
targetAssetType: AssetType!
fieldMapping: JSON!
conflictResolution: ConflictResolution!
syncSchedule: String
}
Scalar Types
Copy
# 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:Copy
{
"type": "Point",
"coordinates": [-97.123, 32.456]
}
Copy
{
"type": "LineString",
"coordinates": [
[-97.123, 32.456],
[-97.234, 32.567],
[-97.345, 32.678]
]
}