rtk-query Questions
3
Solved
I am using the RTK query to handle my requests. But I have a problem canceling requests.
The scenario is like this, I have a modal to show a form to add a todo but, when users want to close the mod...
Ursas asked 14/4, 2022 at 10:28
1
trying to run the first test with redux-toolkit rtk query and got error that api is undefined. What I did wrong?
● Test suite failed to run
TypeError: Cannot read property 'injectEndpoints' of u...
Clementineclementis asked 17/10, 2022 at 13:14
2
Solved
using RTK Query, how can one use the fetching functionality to update another the state of another slice?
Essentially I'm trying to keep all related-state next to each other, and thus after queryin...
Expander asked 8/8, 2021 at 18:33
3
I'm trying to get data from the public Deezer Api located here : https://api.deezer.com/.
To fetch that data i'm using RTK-Query from reduxtoolkit like so (to then use it in my components using hoo...
Richela asked 28/5, 2022 at 6:16
1
Looking to make a component that can take a CSV. (excel) file and upload it to the server.
(with drag and drop functionality, as well as a responsive upload bar showing progress in uploading to the...
Guinevere asked 6/10, 2021 at 13:30
3
I just started using RTK query, but facing a problem
My app has all the setting in one big JSON, so I create an RTK query to fetch the setting. In the tutorial, the examples are about using the use...
Ideo asked 31/8, 2021 at 8:15
3
Solved
I have created multiple RTK Query API services split into multiple files. For this issue I have two services: "Contracts" and "Properties". The contracts service should be able ...
Demoiselle asked 19/9, 2021 at 12:2
1
Solved
The definition for a query in RTK Query is query<ResultType, QueryArg>. All of this is fine for queries where I actually need to send parameters to the API. However, I have some endpoints whi...
Francisfrancisca asked 10/5, 2023 at 7:51
2
Solved
I am trying to use RTK Query mutations to upload a file to the API. Here is my mutation code:
addBanner: builder.mutation({
query(body) {
return {
url: `/api/banners`,
method: 'POST',
body,
...
Motorway asked 2/7, 2021 at 8:4
3
Solved
The following code uses RTK query to create a Redux Hook:
export const specialtiesApi = createApi({
reducerPath: 'specialtiesApi',
baseQuery: fetchBaseQuery({ baseUrl: 'https://someplace.com/' })...
Cuda asked 29/7, 2021 at 0:21
3
Solved
I'm using Typescript with RTK mutation everything is working good but if I send any error from backend in specific JSON format like:
{
status: "Error",
message "Something went wro...
Britt asked 18/11, 2021 at 9:58
2
Solved
NOTE: This now works fine in RTKQuery v2 as it has been rewritten to TypeScript. Original question below.
Short description
I'm trying to compile below piece of TypeScript code. Tsc isn't satisfie...
Urease asked 17/11, 2022 at 9:26
2
just tried to mocked the store then test the request with fetchMock but got this error :
you can check out the full repo on :
https://github.com/alibidjandy/layered-architecture
src/app/main/__test...
3
Solved
I'm using a very basic RTK Query hook to get some user data from an API. How can I access the data saved in my store inside of my components? I'm not able to get the data from the store generated i...
Avogadro asked 7/3, 2022 at 16:18
1
I have integrated RTK query in a project of mine and I'm trying to understand how to handle the UI for my tables. I already had read other StackOverflow questions (e.g. that one) but I wasn't able ...
Wiley asked 7/9, 2022 at 17:25
2
Solved
Recently new react-router 6.4 was released and it has the ability to load data before render of component. (https://reactrouter.com/en/main/start/overview#data-loading)
This seems like a cool featu...
Slaby asked 18/10, 2022 at 8:31
3
Solved
Here's the hook which returns the data based on the page
const {
data,
isFetching,
isLoading,
isError,
} = useGetResourceQuery(page, perPage );
here's the api
export const api = createApi({...
Anaphase asked 9/6, 2021 at 17:49
2
I am attempting to implement infinite scrolling functionality in our current application;
We first fetch the first 5 'Posts' for a page. Upon scrolling to the bottom of the page, we then fetch the ...
Mendenhall asked 7/6, 2022 at 11:6
3
Solved
Can someone help me in implementing the debounce functionality using creatApi with query implementation from redux toolkit.
Thanks in advance.
Penitent asked 10/7, 2021 at 17:26
3
Solved
Project uses redux toolkit and rtk query. Data are fetched from one api, but the code is split into smaller chunks to reflect logical parts like
/vehicles
/users
/settings
...etc
After logout rtk...
Beadledom asked 22/3, 2022 at 13:57
2
I'm using RTK Query to fetch some data. I need to access the loading state across various components in my application, but I'm unsure how to do so.
I feel like it may simply be that I'm misunderst...
Musk asked 6/7, 2022 at 2:29
3
I am fetching data from my api using RTK Query like this
export const coinApi = createApi({
reducerPath: 'coinApi',
baseQuery: fetchBaseQuery({ baseUrl }),
endpoints: (builder) => ({
getCoi...
1
I've tried
initiate - but this result was retrieved from previous result.
mutate - but I think this is irregular.
Is there any way to use await for a normal get request?
relevant questions:
Appr...
Partin asked 12/12, 2021 at 8:23
1
Solved
I really love graphql + rtk query but I cant get the graphql subscriptions working.
I almost directly copied the streaming update example from the redux documentation. But I get the error subscript...
Tidwell asked 16/7, 2022 at 18:42
1
Solved
I use RTK Query to consume an /items/filter API. In the codes below, the debouncedQuery holds a value of query string parameter to be used to call a filter API endpoint. e.g.: In the /items/filter?...
Megillah asked 14/9, 2022 at 23:54
© 2022 - 2024 — McMap. All rights reserved.