From ea46115b86050a3bec627a3e3f9426bed6787ae0 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 7 Apr 2025 12:40:53 -0700 Subject: [PATCH] add system ID to ETA object in graphql schema --- schema.graphqls | 1 + src/resolvers/ShuttleResolvers.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/schema.graphqls b/schema.graphqls index b7634ef..8449ef8 100644 --- a/schema.graphqls +++ b/schema.graphqls @@ -50,6 +50,7 @@ type ETA { shuttle: Shuttle shuttleId: ID! secondsRemaining: Float! + systemId: ID! } type Shuttle { diff --git a/src/resolvers/ShuttleResolvers.ts b/src/resolvers/ShuttleResolvers.ts index 3034ca8..103e40f 100644 --- a/src/resolvers/ShuttleResolvers.ts +++ b/src/resolvers/ShuttleResolvers.ts @@ -17,6 +17,7 @@ export const ShuttleResolvers: Resolvers = { secondsRemaining: etaForStopId.secondsRemaining, shuttleId: parent.id, shuttle: parent, + systemId: system.id, }; }, etas: async (parent, args, contextValue, info) => { @@ -35,6 +36,7 @@ export const ShuttleResolvers: Resolvers = { stopId, shuttle: parent, shuttleId: parent.id, + systemId: system.id, } })); @@ -56,7 +58,7 @@ export const ShuttleResolvers: Resolvers = { id: route.id, name: route.name, polylineCoordinates: route.polylineCoordinates, - systemId: parent.systemId, + systemId: system.id, } } },