prisma model을 작성하고 prisma module을 만들어 user module, post module 등에서 사용할 수 있다.
nestjs에 설치되어 있는 jwt module를 사용함nestjs에 기능 중 guard를 사용하여 gql context에 user를 저장하여 로그인 유무를 확인.decorator 태그를 사용하여 로그인 된 유저를 사용할 수 있다. 예시)
jwt token을 ws 서버에 올리기 위해 어느 서브에서 사용되어지는지에 따라 로그인된 user를 뽑기 위한 setting을 해야한다.guard도 그것에 맞게 바꿔주고이러면 pubsub을 사용할 수 있다.
styled components setting react-router-dom ![](https://images.velog.io/images/nuo/post/dc33b70a-61f2-43c8-bc95-d2f085138f41
apollo codegen 이와 같은 에러가 발생하였다. yarn과 npm에서 graphql version이 달라서 발생하는 상황이다.이 버전으로 node_modules과 yarn cache를 지우고 다시 설치하여 준다. 근데 node 버전이 달라 다시 error가 발
client에 token을 저장하는 법