update query resolvers to add the seconds threshold

This commit is contained in:
2025-03-25 16:00:13 -07:00
parent 99672e749f
commit 717575e004
2 changed files with 22 additions and 11 deletions

View File

@@ -3,10 +3,10 @@ import { Resolvers } from "../generated/graphql";
export const QueryResolvers: Resolvers<ServerContext> = {
Query: {
systems: async (parent, args, contextValue, info) => {
systems: async (_parent, args, contextValue, _info) => {
return await contextValue.repository.getSystems();
},
system: async (parent, args, contextValue, info) => {
system: async (_parent, args, contextValue, _info) => {
if (!args.id) return null;
const system = await contextValue.repository.getSystemById(args.id);
if (system === null) return null;
@@ -19,6 +19,10 @@ export const QueryResolvers: Resolvers<ServerContext> = {
isNotificationScheduled: async (_parent, args, contextValue, _info) => {
const notificationData = args.input;
return contextValue.notificationService.isNotificationScheduled(notificationData);
}
},
secondsThresholdForNotification: async (_parent, args, contextValue, _info) => {
const notificationData = args.input;
return contextValue.notificationService.getSecondsThresholdForScheduledNotification(notificationData);
},
},
}