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);