diff --git a/src/server/types/Outfit.js b/src/server/types/Outfit.js index ba2b00f..cb01d6b 100644 --- a/src/server/types/Outfit.js +++ b/src/server/types/Outfit.js @@ -70,11 +70,22 @@ const resolvers = { }, creator: async ({ id }, _, { outfitLoader }) => { const outfit = await outfitLoader.load(id); - return outfit.userId ? { id: outfit.userId } : null; + if (!outfit.userId) { + return null; + } + + return { id: outfit.userId }; }, }, Query: { - outfit: (_, { id }) => ({ id }), + outfit: async (_, { id }, { outfitLoader }) => { + const outfit = await outfitLoader.load(id); + if (!outfit) { + return null; + } + + return { id }; + }, }, }; diff --git a/src/server/types/Pet.js b/src/server/types/Pet.js index e2baa97..90dd528 100644 --- a/src/server/types/Pet.js +++ b/src/server/types/Pet.js @@ -106,7 +106,6 @@ const resolvers = { items: (...args) => resolvers.Pet.wornItems(...args), }, Query: { - outfit: (_, { id }) => ({ id }), petOnNeopetsDotCom: async ( _, { petName },