Trouble Shooting

xlsoh·2020년 12월 3일
0

기록

목록 보기
3/5

apollo client

    • db를 수정하지 않을경우(GET) => useQuery
    • db를 수정할 경우(POST) => Mutation
      (절대적인 것은 x)
  • 한 컴포넌트 안에서, 두 쿼리문을 사용하니
const { loading, error, data } = useQuery(GET_CRIMERATE);
const [addFavorite, { data }] = useMutation(POST_ADDFAVORITE);

에서
Identifier 'data' has already been declared 에러 발생.
한 컴포넌트 안에서 두 쿼리문 가능하게 할 수 없을까,,

profile
주니어 프론트엔드 개발자

0개의 댓글