Add forking graphQL resolvers
This commit is contained in:
@@ -267,6 +267,10 @@ export const deleteProject = async ({ id }: Prisma.ProjectWhereUniqueInput) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const Project = {
|
export const Project = {
|
||||||
|
forkedFrom: (_obj, { root }) =>
|
||||||
|
root.forkedFromId && db.project.findUnique({where: { id: root.forkedFromId}}),
|
||||||
|
childForks: (_obj, { root }) =>
|
||||||
|
db.project.findMany({where: { forkedFromId: root.id}}),
|
||||||
user: (_obj, { root }: ResolverArgs<ReturnType<typeof project>>) =>
|
user: (_obj, { root }: ResolverArgs<ReturnType<typeof project>>) =>
|
||||||
db.project.findUnique({ where: { id: root.id } }).user(),
|
db.project.findUnique({ where: { id: root.id } }).user(),
|
||||||
socialCard: (_obj, { root }: ResolverArgs<ReturnType<typeof project>>) =>
|
socialCard: (_obj, { root }: ResolverArgs<ReturnType<typeof project>>) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user