From a830dadbeecda2566011ae10877636744ad18064 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Mon, 7 Apr 2025 12:31:16 -0700 Subject: [PATCH] use system ID provided on ordered stop to look for system --- src/resolvers/OrderedStopResolvers.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/resolvers/OrderedStopResolvers.ts b/src/resolvers/OrderedStopResolvers.ts index 21b4f31..0410e46 100644 --- a/src/resolvers/OrderedStopResolvers.ts +++ b/src/resolvers/OrderedStopResolvers.ts @@ -7,8 +7,7 @@ export const OrderedStopResolvers: Resolvers = { const routeId = parent.routeId; const stopId = parent.stopId; - if (!parent.stop) return null; - const system = contextValue.findSystemById(parent.stop.systemId); + const system = contextValue.findSystemById(parent.systemId); if (!system) return null; const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId); @@ -31,8 +30,7 @@ export const OrderedStopResolvers: Resolvers = { const routeId = parent.routeId; const stopId = parent.stopId; - if (!parent.stop) return null; - const system = contextValue.findSystemById(parent.stop.systemId); + const system = contextValue.findSystemById(parent.systemId); if (!system) return null; const currentOrderedStop = await system.shuttleRepository.getOrderedStopByRouteAndStopId(routeId, stopId); @@ -52,15 +50,13 @@ export const OrderedStopResolvers: Resolvers = { } }, stop: async (parent, args, contextValue, _info) => { - if (!parent.stop) return null; - const system = contextValue.findSystemById(parent.stop.systemId); + const system = contextValue.findSystemById(parent.systemId); if (!system) return null; return await system.shuttleRepository.getStopById(parent.stopId); }, route: async (parent, args, contextValue, _info) => { - if (!parent.stop) return null; - const system = contextValue.findSystemById(parent.stop.systemId); + const system = contextValue.findSystemById(parent.systemId); if (!system) return null; return await system.shuttleRepository.getRouteById(parent.routeId);