GraphQL BackEnd/Lecture
GraphQL + Prisma (5) Prisma Connection파트
도도롱
2020. 2. 7. 15:56
# prisma-client-lib 문법 분석 가이드 입니다.
# prisma Prisma Connection파트
yarn prisma-client-lib 이후 프리즈마 데모 서버에서 데이터를 쿼리하는 방법을 정리 했습니다.
# 단순히 공부한 내용을 열거합니다.
---------------------------------------------------------------------------------------------------------------------------
[prisma.usersConnection ]
---------------------------------------------------------------------------------------------------------------------------
#1. 좋아요의 갯수를 합산하기
//컨넥션.aggregate().count()
const likeCount = await prisma
.likesConnection({
where: { post: { id } }
})
.aggregate()
.count();
#2. Post 갯수를 합산하기
// 동일 예제
const res = prisma
.postsConnection({ where: { user: { id } } })
.aggregate()
.count();
DOS IMPACT - WEB Developer
KIM DO YOUNG

WEB : REACT JS | REACT NATIVE | GraphQL PRISMA
