mirror of
https://github.com/wasp-lang/wasp.git
synced 2024-11-30 18:23:19 +03:00
Remove undefined values from query keys (#671)
* Remove undefined values from query keys * Update e2e tests
This commit is contained in:
parent
a0299febbc
commit
67562e32cc
@ -9,8 +9,9 @@ export function useQuery(queryFn, queryFnArgs, options) {
|
|||||||
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryKey = queryFnArgs !== undefined ? [queryFn.queryCacheKey, queryFnArgs] : [queryFn.queryCacheKey]
|
||||||
return rqUseQuery({
|
return rqUseQuery({
|
||||||
queryKey: [queryFn.queryCacheKey, queryFnArgs],
|
queryKey,
|
||||||
queryFn: () => queryFn(queryFnArgs),
|
queryFn: () => queryFn(queryFnArgs),
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
@ -319,7 +319,7 @@
|
|||||||
"file",
|
"file",
|
||||||
"web-app/src/queries/index.js"
|
"web-app/src/queries/index.js"
|
||||||
],
|
],
|
||||||
"8510924f80b32cc0f67ca39fad9d97c4ce5d9695015da3ec8457e91a88868c78"
|
"965368ac8e979667445031addb947baf19055df0df24656c3af4d3abdd86952b"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -9,8 +9,9 @@ export function useQuery(queryFn, queryFnArgs, options) {
|
|||||||
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryKey = queryFnArgs !== undefined ? [queryFn.queryCacheKey, queryFnArgs] : [queryFn.queryCacheKey]
|
||||||
return rqUseQuery({
|
return rqUseQuery({
|
||||||
queryKey: [queryFn.queryCacheKey, queryFnArgs],
|
queryKey,
|
||||||
queryFn: () => queryFn(queryFnArgs),
|
queryFn: () => queryFn(queryFnArgs),
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
@ -319,7 +319,7 @@
|
|||||||
"file",
|
"file",
|
||||||
"web-app/src/queries/index.js"
|
"web-app/src/queries/index.js"
|
||||||
],
|
],
|
||||||
"8510924f80b32cc0f67ca39fad9d97c4ce5d9695015da3ec8457e91a88868c78"
|
"965368ac8e979667445031addb947baf19055df0df24656c3af4d3abdd86952b"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -9,8 +9,9 @@ export function useQuery(queryFn, queryFnArgs, options) {
|
|||||||
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryKey = queryFnArgs !== undefined ? [queryFn.queryCacheKey, queryFnArgs] : [queryFn.queryCacheKey]
|
||||||
return rqUseQuery({
|
return rqUseQuery({
|
||||||
queryKey: [queryFn.queryCacheKey, queryFnArgs],
|
queryKey,
|
||||||
queryFn: () => queryFn(queryFnArgs),
|
queryFn: () => queryFn(queryFnArgs),
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
@ -340,7 +340,7 @@
|
|||||||
"file",
|
"file",
|
||||||
"web-app/src/queries/index.js"
|
"web-app/src/queries/index.js"
|
||||||
],
|
],
|
||||||
"8510924f80b32cc0f67ca39fad9d97c4ce5d9695015da3ec8457e91a88868c78"
|
"965368ac8e979667445031addb947baf19055df0df24656c3af4d3abdd86952b"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -9,8 +9,9 @@ export function useQuery(queryFn, queryFnArgs, options) {
|
|||||||
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryKey = queryFnArgs !== undefined ? [queryFn.queryCacheKey, queryFnArgs] : [queryFn.queryCacheKey]
|
||||||
return rqUseQuery({
|
return rqUseQuery({
|
||||||
queryKey: [queryFn.queryCacheKey, queryFnArgs],
|
queryKey,
|
||||||
queryFn: () => queryFn(queryFnArgs),
|
queryFn: () => queryFn(queryFnArgs),
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
@ -319,7 +319,7 @@
|
|||||||
"file",
|
"file",
|
||||||
"web-app/src/queries/index.js"
|
"web-app/src/queries/index.js"
|
||||||
],
|
],
|
||||||
"8510924f80b32cc0f67ca39fad9d97c4ce5d9695015da3ec8457e91a88868c78"
|
"965368ac8e979667445031addb947baf19055df0df24656c3af4d3abdd86952b"
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
[
|
[
|
||||||
|
@ -9,8 +9,9 @@ export function useQuery(queryFn, queryFnArgs, options) {
|
|||||||
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
throw new TypeError('queryFn needs to have queryCacheKey property defined.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const queryKey = queryFnArgs !== undefined ? [queryFn.queryCacheKey, queryFnArgs] : [queryFn.queryCacheKey]
|
||||||
return rqUseQuery({
|
return rqUseQuery({
|
||||||
queryKey: [queryFn.queryCacheKey, queryFnArgs],
|
queryKey,
|
||||||
queryFn: () => queryFn(queryFnArgs),
|
queryFn: () => queryFn(queryFnArgs),
|
||||||
...options
|
...options
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user