mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-30 20:44:21 +01:00
Support project-categry includes in the query
This commit is contained in:
@@ -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 }
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user