You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hook provides an additional [mutation option](https://tanstack.com/query/latest/docs/framework/react/reference/useMutation) called `invalidate`. This option accepts a list of query references which will be automatically invalidated when the mutation is successful.
Copy file name to clipboardExpand all lines: docs/react/data-connect/querying.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,25 +5,25 @@ description: Learn how to query data from Firebase Data Connect using the Tansta
5
5
6
6
## Querying Data
7
7
8
-
To query data from Firebase Data Connect, you can use the `useConnectQuery` hook. This hook will automatically infer the data type from the connector and the query and automtically create a [query key](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) for the query.
8
+
To query data from Firebase Data Connect, you can use the `useDataConnectQuery` hook. This hook will automatically infer the data type from the connector and the query and automtically create a [query key](https://tanstack.com/query/latest/docs/framework/react/guides/query-keys) for the query.
To leverage the full power of Tanstack Query, you can pass in query options to the `useConnectQuery` hook, for example to refetch the query on a interval:
23
+
To leverage the full power of Tanstack Query, you can pass in query options to the `useDataConnectQuery` hook, for example to refetch the query on a interval:
Copy file name to clipboardExpand all lines: docs/react/data-connect/server-side-rendering.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ export default function MoviesRoute({
45
45
}
46
46
47
47
function Movies() {
48
-
const movies =useConnectQuery(listMoviesRef());
48
+
const movies =useDataConnectQuery(listMoviesRef());
49
49
50
50
if (movies.isLoading) {
51
51
return <div>Loading...</div>;
@@ -94,13 +94,13 @@ export default async function PostsPage() {
94
94
}
95
95
96
96
function Movies() {
97
-
const movies =useConnectQuery(listMoviesRef());
97
+
const movies =useDataConnectQuery(listMoviesRef());
98
98
99
99
// ...
100
100
}
101
101
```
102
102
103
103
### Gotchas
104
104
105
-
- If you opt-in to providing a custom `queryKey` to either the prefetched data or the `useConnectQuery` hook, you must ensure that the `queryKey` is the same for both.
105
+
- If you opt-in to providing a custom `queryKey` to either the prefetched data or the `useDataConnectQuery` hook, you must ensure that the `queryKey` is the same for both.
106
106
- By default, the client will always refetch data in the background. If this behaviour is not desired, you can set the `staleTime` option in your Query Client or hook options.
0 commit comments