mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +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) => {
|
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,
|
||||||
|
|||||||
Reference in New Issue
Block a user