인스타그램 클론 코딩/#2 Prisma 소개 및 설정
#2.2 프리즈마 테스팅
정중식
2019. 12. 18. 20:27
// 유저 생성은 이런식으로
mutation {
createUser(data:{username:"정준식",email:"wndtlr@tlrdl.com"}){
id
}
}
connect: {id}의 사용자가 where:{id}의 사용자를 팔로잉하고
where문 이후에 오는건 조회 한다는 뜻
mutation{
updateUser(data:{following:{
connect:{
id:"ck4b70b3idxl40993lu7gpdj2"
}
}}where:{id:"ck4b6wz3ri6f00922id0t735e"}){
username
firstName
lastName
following{
id
username
}
followers{
id
}
}
}