Skip to content

Commit

Permalink
chore: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
psteinroe committed Jul 14, 2024
1 parent 879ca4a commit 42a5e84
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions docs/pages/postgrest/queries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,6 @@ import { Callout, Tabs, Tab } from "nextra-theme-docs";

# Queries

<Callout emoji="⚠️ ">
Unfortunately, we require you to be explicit in the select statement fields,
and not use a wildcard ('*'), since mutations need to know the columns to
derive whether the query cache should be updated with new values. Note that
the wildcard selector is not allowed on any level, so you can't use it for
relations either.
</Callout>

The cache helpers query hooks wrap the data fetching hooks of the cache libraries and pass both the cache key and the fetcher function from on the PostgREST query. This is enabled primarily by a parser that turns any Supabase PostgREST query into a definite cache key. For example,

```ts
Expand All @@ -32,6 +24,13 @@ is parsed into
</Tab>
</Tabs>

<Callout emoji="⚠️ ">
Although you can use wildcards (`*`) in your query, their usages are only
recommended for `head: true` and `count: true` queries. For any other query,
you should be explicit about the columns you want to select. Only then is
cache helpers able to do granular cache updates without refetching.
</Callout>

## `useQuery`

Wrapper around the default data fetching hook that returns the query including the count without any modification of the data. The config parameter of the respective library can be passed as the second argument.
Expand Down

0 comments on commit 42a5e84

Please sign in to comment.