Cell query not returning correct data

Hi,

I’ve got a weird issue with a list where, when I’m updating items, the cell query is being refetched but the items are not being filtered properly. For example, if the update is to delete a list item, that item is still returned after the refetch. I am also filtering for items that are missing data in a specific field - when updating each item, they are still returned in the query results (with the newly-entered data in the field).

I’ve got two views of the same list, one of which uses a date as a route parameter and the other that doesn’t filter by date. The second one is working fine - the items are correctly removed from the list when deleting and updating.

I’m wondering if there is any specific query behaviour when using route params - could it be a caching issue of some sort?

Hope some of that makes sense - thanks in advance for any help!

Finally figured it out! I realised the variable (route parameter) wasn’t being included in the refetched query - a review of the Apollo docs showed how to include these (HOC - Apollo GraphQL Docs):

    refetchQueries: [{ query: QUERY, variables: { [add_variable_here] } }],
2 Likes