Open History to see the last commit
1---
2id: query-functions
3title: Query Functions
4ref: docs/framework/react/guides/query-functions.md
5---
6β
7[//]: # 'Example4'
8β
9```js
10const result = useQuery({
11 queryKey: ['todos', { status, page }],
12 queryFn: fetchTodoList,
13})
14β
15// Access the key, status and page variables in your query function!
16function fetchTodoList({ queryKey }) {
17 const [_key, { status, page }] = queryKey
18 return new Promise()
19}
20```
21β
22[//]: # 'Example4'