Skip to content

Commit 1e5f34c

Browse files
committed
Merge remote-tracking branch 'origin/master' into v1.9-integration
2 parents c630e83 + aa59f75 commit 1e5f34c

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

docs/rtk-query/usage/customizing-queries.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ const api = createApi({
950950
async queryFn(_arg, _queryApi, _extraOptions, fetchWithBQ) {
951951
// get a random user
952952
const randomResult = await fetchWithBQ('users/random')
953-
if (randomResult.error) throw randomResult.error
953+
if (randomResult.error) return { error: randomResult.error as FetchBaseQueryError }
954954
const user = randomResult.data as User
955955
const result = await fetchWithBQ(`user/${user.id}/posts`)
956956
return result.data

packages/toolkit/src/query/react/buildHooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ interface UseQuerySubscriptionOptions extends SubscriptionOptions {
109109
* - **If the query has cached data:**
110110
* * The cached data **will not be used** on the initial load, and will ignore updates from any identical query until the `skip` condition is removed
111111
* * The query will have a status of `uninitialized`
112-
* * If `skip: false` is set after skipping the initial load, the cached result will be used
112+
* * If `skip: false` is set after the initial load, the cached result will be used
113113
* - **If the query does not have cached data:**
114114
* * The query will have a status of `uninitialized`
115115
* * The query will not exist in the state when viewed with the dev tools
@@ -185,7 +185,7 @@ export type UseLazyQueryLastPromiseInfo<
185185
*
186186
* #### Note
187187
*
188-
* When the trigger function returned from a LazyQuery, it always initiates a new request to the server even if there is cached data. Set `preferCacheValue`(the second argument to the function) as `true` if you want it to immediately return a cached value if one exists.
188+
* When the trigger function returned from a LazyQuery is called, it always initiates a new request to the server even if there is cached data. Set `preferCacheValue`(the second argument to the function) as `true` if you want it to immediately return a cached value if one exists.
189189
*/
190190
export type UseLazyQuery<D extends QueryDefinition<any, any, any, any>> = <
191191
R extends Record<string, any> = UseQueryStateDefaultResult<D>

packages/toolkit/src/query/tests/createApi.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,6 @@ describe('endpoint definition typings', () => {
436436

437437
storeRef.store.dispatch(api.endpoints.query2.initiate('in2'))
438438
await waitMs(1)
439-
debugger
440439
expect(spy).toHaveBeenCalledWith(
441440
"Tag type 'missing' was used, but not specified in `tagTypes`!"
442441
)

0 commit comments

Comments
 (0)