Files
project-inter-server/schema.graphqls
Claude 946f8dd342 Add initial region loading for supported systems
Expose an initialRegion field on the System GraphQL type so the app can
display the correct campus area on first load instead of a zoomed-out
default map view. Chapman University is configured with coordinates
centered on campus.

https://claude.ai/code/session_0162emnCi1KxW5FkTNn2ZrvH
2026-03-23 22:02:42 +00:00

156 lines
2.7 KiB
GraphQL

scalar DateTime
# The Interchange system schema.
# Note how Passio ID and parking ID are abstracted away
# from the endpoints.
type System {
id: ID!
name: String!
initialRegion: Region
routes: [Route!]
route(id: ID): Route
stops: [Stop!]
stop(id: ID): Stop
shuttles: [Shuttle!]
shuttle(id: ID): Shuttle
parkingSystem: ParkingSystem
}
type Region {
latitude: Float!
longitude: Float!
latitudeDelta: Float!
longitudeDelta: Float!
}
type ParkingSystem {
systemId: ID!
parkingStructures: [ParkingStructure!]
parkingStructure(id: ID): ParkingStructure
}
type ParkingStructure {
id: ID!
name: String!
capacity: Int!
spotsAvailable: Int!
coordinates: Coordinates!
address: String!
updatedTime: DateTime
systemId: ID!
historicalAverages(input: HistoricalParkingAverageQueryInput): [HistoricalParkingAverageQueryResult!]
}
type HistoricalParkingAverageQueryResult {
from: DateTime!
to: DateTime!
averageSpotsAvailable: Float!
}
input HistoricalParkingAverageQueryInput {
from: DateTime!
to: DateTime!
intervalMs: Int!
}
type Route {
name: String!
id: ID!
systemId: ID!
orderedStop(forStopId: ID): OrderedStop
orderedStops: [OrderedStop]
shuttles: [Shuttle!]
polylineCoordinates: [Coordinates!]!
color: String!
updatedTime: DateTime
}
type OrderedStop {
nextStop: OrderedStop
previousStop: OrderedStop
route: Route
routeId: ID!
stop: Stop
stopId: ID!
systemId: ID!
updatedTime: DateTime
}
type Stop {
id: ID!
systemId: ID!
name: String!
coordinates: Coordinates!
etas: [ETA!]
orderedStops: [OrderedStop!]
updatedTime: DateTime
}
type Coordinates {
latitude: Float!
longitude: Float!
}
type ETA {
stop: Stop
stopId: ID!
shuttle: Shuttle
shuttleId: ID!
secondsRemaining: Float!
systemId: ID!
updatedTime: DateTime
}
type Shuttle {
name: String!
systemId: ID!
id: ID!,
coordinates: Coordinates!
route: Route
routeId: ID!
etas: [ETA!]
eta(forStopId: ID): ETA
orientationInDegrees: Float!
updatedTime: DateTime
}
# Queries
type Query {
systems: [System!]!
system(id: ID): System
isNotificationScheduled(input: NotificationInput!): Boolean
secondsThresholdForNotification(input: NotificationInput!): Int
schemaMinVersion: Int!
schemaCurrentVersion: Int!
}
# 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
}