Skip to content

Commit 43d94a0

Browse files
authored
Merge pull request #3158 from petermekhaeil/master
2 parents bdf8af3 + d53eea2 commit 43d94a0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

docs/rtk-query/api/createApi.mdx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,15 @@ export const { useGetPokemonByNameQuery } = pokemonApi
8282
#### baseQuery function arguments
8383

8484
- `args` - The return value of the `query` function for a given endpoint
85-
- `api` - The `BaseQueryApi` object, containing `signal`, `dispatch`, `getState` and `extra` properties
85+
- `api` - The `BaseQueryApi` object contains:
8686
- `signal` - An [`AbortSignal`](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) object that may be used to abort DOM requests and/or read whether the request is aborted.
87+
- `abort` - The [`abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort) method of the AbortController attached to `signal`.
8788
- `dispatch` - The `store.dispatch` method for the corresponding Redux store
8889
- `getState` - A function that may be called to access the current store state
8990
- `extra` - Provided as thunk.extraArgument to the configureStore getDefaultMiddleware option.
91+
- `endpoint` - The name of the endpoint.
92+
- `type` - Type of request (`query` or `mutation`).
93+
- `forced` - Indicates if a query has been forced.
9094
- `extraOptions` - The value of the optional `extraOptions` property provided for a given endpoint
9195

9296
#### baseQuery function signature
@@ -106,8 +110,13 @@ export type BaseQueryFn<
106110

107111
export interface BaseQueryApi {
108112
signal: AbortSignal
113+
abort: (reason?: string) => void
109114
dispatch: ThunkDispatch<any, any, any>
110115
getState: () => unknown
116+
extra: unknown
117+
endpoint: string
118+
type: 'query' | 'mutation'
119+
forced?: boolean
111120
}
112121

113122
export type QueryReturnValue<T = unknown, E = unknown, M = unknown> =

0 commit comments

Comments
 (0)