From 472b3a0b0537671ad9a02818a63fa8dabcff75e7 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Sun, 6 Apr 2025 11:28:13 -0700 Subject: [PATCH] add system ID as parent ID in system resolvers --- src/resolvers/SystemResolvers.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/resolvers/SystemResolvers.ts b/src/resolvers/SystemResolvers.ts index 415d0b3..dd3c856 100644 --- a/src/resolvers/SystemResolvers.ts +++ b/src/resolvers/SystemResolvers.ts @@ -3,7 +3,7 @@ import { ServerContext } from "../ServerContext"; export const SystemResolvers: Resolvers = { System: { - routes: async (parent, args, contextValue, info) => { + routes: async (parent, args, contextValue, _info) => { const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { return []; @@ -11,7 +11,7 @@ export const SystemResolvers: Resolvers = { return await system.shuttleRepository.getRoutesBySystemId(parent.id); }, - stops: async (parent, args, contextValue, info) => { + stops: async (parent, args, contextValue, _info) => { const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { return []; @@ -19,7 +19,7 @@ export const SystemResolvers: Resolvers = { return await system.shuttleRepository.getStopsBySystemId(parent.id); }, - stop: async (parent, args, contextValue, info) => { + stop: async (parent, args, contextValue, _info) => { if (!args.id) return null; const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { @@ -35,9 +35,10 @@ export const SystemResolvers: Resolvers = { id: stop.id, name: stop.name, coordinates: stop.coordinates as Coordinates, + systemId: parent.id, }; }, - route: async (parent, args, contextValue, info) => { + route: async (parent, args, contextValue, _info) => { if (!args.id) return null; const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { @@ -53,9 +54,10 @@ export const SystemResolvers: Resolvers = { id: route.id, name: route.name, polylineCoordinates: route.polylineCoordinates as Coordinates[], + systemId: parent.id, }; }, - shuttle: async (parent, args, contextValue, info) => { + shuttle: async (parent, args, contextValue, _info) => { if (!args.id) return null; const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { @@ -68,7 +70,7 @@ export const SystemResolvers: Resolvers = { return shuttle; }, - shuttles: async (parent, args, contextValue, info) => { + shuttles: async (parent, args, contextValue, _info) => { const system = contextValue.systems.find((system) => system.id === parent.id); if (!system) { return [];