I'm trying to make a client side only notification (data not from the server) with react and apollo-link-state as a data store I'm asking how to fetch data from cache every 2 seconds (polling) ,the data is @client state data not from the server as i said.
this is the My Query:
const GET_NOTIF_LIST = gql`
{
notificationsState @client {
notifications {
uid
title
message
type
position
autodismiss
__typename
}
}
}
`;
and this is the component that should poll data from the cache only :
render(){
return (
<Query query={GET_NOTIF_LIST} >
{({ loading, error, data }) => {
return (<NotificationSystemComponent notifications={data.notificationsState.notifications || []} />)
}}
</Query>
)
}