Skip to content
Source
Docs
Explore
Skills
MCP servers
For agents
Search or jump to…
Sign in
Sign up
TanStack
/
query
Pull requests
TanStack
query
Public
Synced with GitHub
Popular #8
Fork
0
0
0
0
1
2
3
4
5
6
7
8
9
Code
Architecture
Issues
Pull requests
Community
Assets
CI
Agents
Settings
fix(types): make sure queryOptions are passable to UseQueryOptions
#8317
Send to my agent
Merged
TkDodo
merged 1 commit into
main
from
refs/pull/8317/head
·
merged by
TkDodo
2 years ago
View on GitHub
Conversation
3
Commits
1
Files changed
2
Impact
Showing
2 changed files
with
18 additions
and
4 deletions
.
x
0 of 2 viewed, 2 left
Files
Hide whitespace
Unified
Split
14 additions and 0 deletions
+14
-0
packages/react-query/src/__tests__/queryOptions.test-d.tsx
Modified
Diff
Before/After
Viewed
packages/react-query/src/__tests__/queryOptions.test-d.tsx
View file
Show all 8 lines
@@ -9,6 +9,7 @@
9
9
import
{ useQuery }
from
'../useQuery'
10
10
import
{ useQueries }
from
'../useQueries'
11
11
import
{ useSuspenseQuery }
from
'../useSuspenseQuery'
12
+
import
type
{
UseQueryOptions
}
from
'../types'
12
13
import
type
{
13
14
InitialDataFunction
,
14
15
QueryObserverResult
,
Expand up
Expand down
Show all 218 lines
@@ -233,4 +234,17 @@
233
234
testFn
(
'id'
)
234
235
testFn
()
235
236
})
237
+
238
+
it
(
'should be passable to UseQueryOptions'
, () => {
239
+
function
somethingWithQueryOptions
(options:
UseQueryOptions
<
number
>) {
240
+
return
options.
queryKey
241
+
}
242
+
243
+
const
options =
queryOptions
({
244
+
queryKey
: [
'key'
],
245
+
queryFn
: () =>
Promise
.
resolve
(
1
),
246
+
})
247
+
248
+
somethingWithQueryOptions
(options)
249
+
})
Home
Search
Explore
Menu