I’m testing out Apollo reactive vars, but my query / component is not updated without calling refetch(), is this intended or am I doing something wrong?
Some code:
export const ticketStatusVar = makeVar<TicketStatuses>(TicketStatuses.Open);
const TicketList: React.FC<Props> = (props) => {
const ticketStatus = useReactiveVar(ticketStatusVar);
const { data, fetchMore } =
useGetTicketListQuery({
variables: {
cursor: undefined,
ticketStatus: ticketStatus
},
notifyOnNetworkStatusChange: true,
});
return (
<div>
<Select
options={[TicketStatuses.Open, TicketStatuses.Closed]}
onChange={value => {
ticketStatusVar(value);
// refetch(); // Won't re-render without this??
}}
/>
</div>
);
}