Answer the question
In order to leave comments, you need to log in
Repeat query in graphql on component initialization?
I have a query that should only fire when the PAGE state changes.
const { data, error, loading, refetch } = useCatalogPageQuery({
variables: { page }
});
useEffect(() => {
refetch()
}, [page]);
Answer the question
In order to leave comments, you need to log in
Answer - you need to set the skip parameter
const { data, error, loading, refetch } = useCatalogPageQuery({
variables: { page },
skip: true
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question