From 35ed8acdcb653fc7a1a71cfe36194cd088440c1f Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Sun, 28 Nov 2021 13:15:50 -0600 Subject: [PATCH] Support project-categry includes in the query --- functions/graphql/resolvers.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/functions/graphql/resolvers.js b/functions/graphql/resolvers.js index cfb69a8..ac81fee 100644 --- a/functions/graphql/resolvers.js +++ b/functions/graphql/resolvers.js @@ -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 } }); }, },