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) => {
if (!args.id) return null;
const system = contextValue.systems.find((system) => {
return system.id === args.id;
});
if (system === undefined) return null;
const system = contextValue.findSystemById(args.id);
if (system === null) return null;
return {
name: system.name,