From 3fca362c14dc796a8c41059654ccd6d367cb570f Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Tue, 28 Jan 2025 20:38:17 -0800 Subject: [PATCH] simplify stops resolver to one statement --- src/resolvers/SystemResolvers.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/resolvers/SystemResolvers.ts b/src/resolvers/SystemResolvers.ts index b78e922..e5391d7 100644 --- a/src/resolvers/SystemResolvers.ts +++ b/src/resolvers/SystemResolvers.ts @@ -7,17 +7,7 @@ export const SystemResolvers: Resolvers = { return await contextValue.repository.getRoutesBySystemId(parent.id); }, stops: async (parent, args, contextValue, info) => { - const stops = await contextValue.repository.getStopsBySystemId(parent.id); - return stops.map(({ - id, - name, - coordinates - }) => ({ - id, - name, - // Both ICoordinates and Coordinates have the same definition - coordinates: coordinates as Coordinates, - })); + return await contextValue.repository.getStopsBySystemId(parent.id); }, stop: async (parent, args, contextValue, info) => { if (!args.id) return null;