Skip to content

Stale While Revalidate - Wrong information in the comparison table #2151

@Mikilll94

Description

@Mikilll94

Screenshot 2021-04-19 at 21 45 31
Screenshot 2021-04-19 at 21 45 13

The comparison here: https://react-query.tanstack.com/comparison is wrong.

Stale While Revalidate is really straightforward to implement in Apollo Client.

const ItemList = () => {
  const { data, loading, error } = useQuery(
    GET_ITEMS, { fetchPolicy: 'cache-and-network' }
  );

  if (!data && loading) return <Loading />;
  if (error) return <p>ERROR: {error.message}</p>;

  return (
        <>
          {data.items.map(item => (
            <Item key={item.id} item={item} />
          ))}
      </>
  );
}

I know that the term "Stale While Revalidate" is not used in the Apollo docs but implementing such UI behavior is really simple.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions