Support project-categry includes in the query

This commit is contained in:
Michael Bumann
2021-11-28 13:15:50 -06:00
parent 8aefd41378
commit 35ed8acdcb

View File

@@ -35,13 +35,16 @@ module.exports = {
return context.prisma.category.findMany();
},
allProjects: async (_source, args, context) => {
return context.prisma.project.findMany();
return context.prisma.project.findMany({
include: { category: true }
});
},
getProject: async (_source, args, context) => {
return context.prisma.project.findUnique({
where: {
id: args.id,
},
include: { category: true }
});
},
},