react-apollo-hooks
react-apollo-hooks copied to clipboard
Is it possible to query with pagination?
Something like fetchMore
: https://www.apollographql.com/docs/react/features/pagination/
Thanks a lot!
Yes, useQuery
returns some helper functions like fetchMore, updateQuery...
const { fetchMore } = useQuery(QUERY)
Yes,
useQuery
returns some helper functions like fetchMore, updateQuery...const { fetchMore } = useQuery(QUERY)
I have an issue with fetchMore and fetchPolicy: 'no-cache', it is not rendering the updateQuery new data
updateQuery: (prev, nexData) => {
if (!nexData.fetchMoreResult) return prev;
const newList = {
...prev,
list: [...prev.issues, ...nexData.fetchMoreResult.list]
};
return newList;
}
oh thanks !!!! :)