mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
123 lines
2.0 KiB
GraphQL
123 lines
2.0 KiB
GraphQL
# The Interchange system schema.
|
|
# Note how Passio ID and parking ID are abstracted away
|
|
# from the endpoints.
|
|
type System {
|
|
id: ID!
|
|
name: String!
|
|
routes: [Route!]
|
|
route(id: ID): Route
|
|
stops: [Stop!]
|
|
stop(id: ID): Stop
|
|
shuttles: [Shuttle!]
|
|
shuttle(id: ID): Shuttle
|
|
|
|
parkingSystem: ParkingSystem
|
|
}
|
|
|
|
type ParkingSystem {
|
|
systemId: ID!
|
|
parkingStructures: [ParkingStructure!]
|
|
parkingStructure(id: ID): ParkingStructure
|
|
}
|
|
|
|
type ParkingStructure {
|
|
id: ID!
|
|
name: String!
|
|
capacity: Int!
|
|
spotsAvailable: Int!
|
|
coordinates: Coordinates!
|
|
address: String!
|
|
}
|
|
|
|
type Route {
|
|
name: String!
|
|
id: ID!
|
|
systemId: ID!
|
|
orderedStop(forStopId: ID): OrderedStop
|
|
shuttles: [Shuttle!]
|
|
polylineCoordinates: [Coordinates!]!
|
|
color: String!
|
|
}
|
|
|
|
type OrderedStop {
|
|
nextStop: OrderedStop
|
|
previousStop: OrderedStop
|
|
route: Route
|
|
routeId: ID!
|
|
stop: Stop
|
|
stopId: ID!
|
|
systemId: ID!
|
|
}
|
|
|
|
type Stop {
|
|
id: ID!
|
|
systemId: ID!
|
|
name: String!
|
|
coordinates: Coordinates!
|
|
etas: [ETA!]
|
|
orderedStops: [OrderedStop!]
|
|
}
|
|
|
|
type Coordinates {
|
|
latitude: Float!
|
|
longitude: Float!
|
|
}
|
|
|
|
type ETA {
|
|
stop: Stop
|
|
stopId: ID!
|
|
shuttle: Shuttle
|
|
shuttleId: ID!
|
|
secondsRemaining: Float!
|
|
systemId: ID!
|
|
}
|
|
|
|
type Shuttle {
|
|
name: String!
|
|
systemId: ID!
|
|
id: ID!,
|
|
coordinates: Coordinates!
|
|
route: Route
|
|
routeId: ID!
|
|
etas: [ETA!]
|
|
eta(forStopId: ID): ETA
|
|
orientationInDegrees: Float!
|
|
}
|
|
|
|
# Queries
|
|
type Query {
|
|
systems: [System!]!
|
|
system(id: ID): System
|
|
|
|
isNotificationScheduled(input: NotificationInput!): Boolean
|
|
secondsThresholdForNotification(input: NotificationInput!): Int
|
|
|
|
schemaVersion: ID!
|
|
}
|
|
|
|
# Mutations
|
|
type Mutation {
|
|
scheduleNotification(input: NotificationInput!): NotificationResponse!
|
|
cancelNotification(input: NotificationInput!): NotificationResponse!
|
|
}
|
|
|
|
input NotificationInput {
|
|
deviceId: ID!
|
|
shuttleId: ID!
|
|
stopId: ID!
|
|
secondsThreshold: Int
|
|
}
|
|
|
|
type NotificationResponse {
|
|
success: Boolean!
|
|
message: String!
|
|
data: Notification
|
|
}
|
|
|
|
type Notification {
|
|
deviceId: ID!
|
|
shuttleId: ID!
|
|
stopId: ID!
|
|
secondsThreshold: Int
|
|
}
|