All Questions
636 questions
0
votes
1
answer
65
views
RTKQuery with SignalR Websocket
I'm attempting to use RTK Query with a signalR websocket service to keep my react app up to date with server data.
My RTK API looks like this:
export const hubConnection = new signalR....
1
vote
1
answer
79
views
How to get cached data in RTK-Query using useLazyQuery?
I am having issues understanding how to get useLazyQuery to get the cached data on a second time the component is mounted.
Imagine the following:
...
const [trigger, { data }] = api.useLazyQuery(); /...
1
vote
1
answer
84
views
Redux-Toolkit (RTK) Query get mutation endpoint loading state
I have a component (like a dialog box) that provides the Submit button. This dialog component then renders a form component.
Form component includes all the fields and also RTK Query to send the ...
-1
votes
1
answer
93
views
Why am I getting 'X is not a function or its return value is not iterable' in JavaScript?
I am trying to iterate over the result of calling function X, but I get the error: 'X is not a function or its return value is not iterable.
I am using RTK Query. I am fetching data using post call on ...
1
vote
2
answers
65
views
How to Refetch Data from One Microservice After a Mutation in Another Using RTK Query?
I’m working with microservices in a React app using Redux Toolkit (RTK) Query. I have two separate APIs:
Service A: For posting data (postData).
Service B: For fetching data (getData).
After ...
0
votes
0
answers
78
views
Cant read Action Payload returned from a RTK Query Fetch using Middleware
Im trying to read a payload from an action that is dispatched with RTKQuery, it is from an async thunk internally that RTK uses. I want to make it global handling using a middleware.
export const ...
-1
votes
1
answer
282
views
Next JS Access to HTTP-only cookies from the client
While rewriting an app from CRA to Next.js, I encountered an issue with using a JWT access token for client-side requests.
Previously, the token was stored in localStorage, making it easy to add to ...
1
vote
1
answer
131
views
How to update query cache when we are using parameters in the main query call?
I am currently trying to implement Redux-Toolkit Query for the first time and am facing issue in delete item implementation. As mentioned by other people on this topic, I also face the issue of get ...
0
votes
0
answers
27
views
Implementing the correct query in generateMetadata [duplicate]
I am using next js and rtk query in my project. I came across something that I need to do generateMetadata. I looked at examples and in them queries are done via Axios. I don't see the point in ...
2
votes
1
answer
196
views
Query Polling not getting data when interval time is met
I have been working with Redux-Toolkit Query and trying to get polling to work with an API call that I have. I've pretty much copied the one from the documentation they have and put it in my project. ...
1
vote
2
answers
75
views
providesTags of Redux-Toolkit Query is returning an error at the first request, while the succeeding request are saying success
I am trying to implement pagination for the test results page.
undefined testResultsApiSlice.jsx:33
testResultsList testResultsApiSlice.jsx:34
GET http://localhost:3500/testResults? 400 (Bad Request) ...
1
vote
1
answer
272
views
redux toolkit + RTK query dynamic slice Injection using combineSlices
We are creating an application on the React + Redux Toolkit + RTK Query + Webpack Module Federation + Nx stack. The idea is to split a large application into modules, create a global store and fill it ...
0
votes
1
answer
54
views
How to use a piece of data returned from RTK query in a slice as default/initial state?
I am trying to figure out a way of using a piece of data returned from RTK query in a slice as default state.
Let's say I have this data returned from an API call and I use RTK query to get the data.
...
0
votes
0
answers
51
views
How to handle dynamic data updates in an offline React app?
I'm using RTK Query to fetch data from a REST API in my React app. To improve offline capabilities, I want to cache data using both IndexedDB and Cache Storage. How can I effectively handle dynamic ...
0
votes
0
answers
64
views
How do I know if an error was handled in a .catch() block when using rtk-query middleware?
I use rtk-query and I have a mutation query. After the query is executed, some actions are performed in the .then() block and then the error is processed in .catch().
Also, a middleware is written ...