useQuery with refetch vs useLazyQuery with useEffect
const [func] = useLazyQuery(QUERY, {
oncompleted: (res) => {
// callback function
}
})
참고 링크
1. useQuery refetch
https://www.apollographql.com/docs/react/data/queries/#refetching
2. useQuery params
https://www.apollographql.com/docs/react/api/react/hooks/#result
3. How do I use onComplete with useQuery?
https://github.com/trojanowski/react-apollo-hooks/issues/106
4. Wait for useLazyQuery response
https://stackoverflow.com/questions/62122523/wait-for-uselazyquery-response
5. How to render useQuery both on first render and onclick?
6. useQuery with onCompleted: infinite loop
https://github.com/apollographql/react-apollo/issues/4044
7. how to get the data from useQuery in onSuccess callback?
'GraphQL' 카테고리의 다른 글
22.01.05 [graphQL] GET supports only query operation (0) | 2022.01.05 |
---|---|
21.10.20 query, mutation (0) | 2021.10.20 |