use findSystemById function in query resolvers

This commit is contained in:
2025-04-07 12:18:07 -07:00
parent 3d13bad11c
commit d950156161

View File

@@ -13,10 +13,8 @@ export const QueryResolvers: Resolvers<ServerContext> = {
}, },
system: async (_parent, args, contextValue, _info) => { system: async (_parent, args, contextValue, _info) => {
if (!args.id) return null; if (!args.id) return null;
const system = contextValue.systems.find((system) => { const system = contextValue.findSystemById(args.id);
return system.id === args.id; if (system === null) return null;
});
if (system === undefined) return null;
return { return {
name: system.name, name: system.name,