mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
22 lines
694 B
TypeScript
22 lines
694 B
TypeScript
import { Resolvers } from "../generated/graphql";
|
|
import { ServerContext } from "../ServerContext";
|
|
|
|
export const StopResolvers: Resolvers<ServerContext> = {
|
|
Stop: {
|
|
orderedStops: async (parent, args, contextValue, _info) => {
|
|
const system = contextValue.findSystemById(parent.systemId);
|
|
if (!system) {
|
|
return [];
|
|
}
|
|
return await system.shuttleRepository.getOrderedStopsByStopId(parent.id);
|
|
},
|
|
etas: async (parent, args, contextValue, _info) => {
|
|
const system = contextValue.findSystemById(parent.systemId);
|
|
if (!system) {
|
|
return [];
|
|
}
|
|
return await system.shuttleRepository.getEtasForStopId(parent.id);
|
|
},
|
|
},
|
|
}
|