mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
use findSystemById function in query resolvers
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user