# ChannelFilter type · @imqueue/pg-cache

Source: https://imqueue.org/api/pg-cache/latest/pg-cache.channelfilter/
Published: 2026-08-04
Author: @imqueue maintainers (https://github.com/imqueue)
Package: @imqueue/pg-cache 5.0.6 — generated reference, not hand-written

Narrows which changes to a table invalidate a cached method.

The two forms behave in OPPOSITE directions, which is easy to get wrong:

- A [ChannelOperation](https://imqueue.org/api/pg-cache/latest/pg-cache.channeloperation/) array is an \*\*exclusion\*\* list. Operations named in it do NOT invalidate; everything else does. So `[ChannelOperation.DELETE]` means "invalidate on inserts and updates, ignore deletes" — not "invalidate on deletes". - A [ChannelPayloadFilter](https://imqueue.org/api/pg-cache/latest/pg-cache.channelpayloadfilter/) is an \*\*inclusion\*\* predicate: it invalidates when it returns `true`.

Omitting the filter invalidates on every change to the table.

**Signature:**

```typescript
export type ChannelFilter = ChannelOperation[] | ChannelPayloadFilter;
```
**References:** [ChannelOperation](https://imqueue.org/api/pg-cache/latest/pg-cache.channeloperation/), [ChannelPayloadFilter](https://imqueue.org/api/pg-cache/latest/pg-cache.channelpayloadfilter/)

