All Questions
12 questions
0
votes
0
answers
379
views
How to use credentials outside of rtk-query?
We use a graphql basequery with rtk-query. In the basequery, I use credentials: "include" and this works fine. I'm able to get the cookie and it's used for all requests.
export const api = ...
1
vote
1
answer
4k
views
How to access, update and delete cached data in RTK query?
So I am using RTK query in my app and I have used it in multiple apps before (and it seems easy and saves a lot of time). But I have a question regarding authentication.
So how I have been handling ...
3
votes
0
answers
309
views
How to change baseQuery redux when language changing with i18n?
I need to change baseQuery when AsyncSorage variable changing or i18n language changing (this the same thing).
This code works, but it doesn't change dynamically. I need to reload app and language are ...
1
vote
1
answer
7k
views
AxiosBaseQuery error handling in RTK-Query
I have a simple AxiosBaseQuery very similar to the one provided in the docs:
https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#axios-basequery
Specifically, in the catch block, you can ...
2
votes
1
answer
5k
views
How to make a response interceptor in RTK Query
I need to redirect to log in screen and clear the authentication token when the response status from an API is unauthorized.
I could do this in Angular easily by providing an HTTP interceptor to the ...
0
votes
0
answers
352
views
RTK mutation POST with an array iteration
I have two table set up one for a people and another for drinks consumed. This means that i have a pivot table and i need to post an array of drinks consumed in my rtk query. How do i go about this?
...
2
votes
1
answer
730
views
redux-toolkit query auth persist
Hello I have created a application that working fine to create user, fetch users, add post, reaction, delete a post. now I want to add AUTH to my application. but I m confused how to persist the state,...
1
vote
1
answer
877
views
Expo Secure Store and RTK Query
I am new to react/mobile development and was wondering the best way to securely store a token. The official documentation points to expo secure store which i'm trying to now implement.
I am also using ...
1
vote
1
answer
3k
views
Use Redux Offline with RTK-Query
Has anyone been successful in marrying Redux Offline with RTK Query?
I'm unsure how to decorate RTK query mutations with offline metadata, as described in the RTK Query docs:
const registerUser = (...
11
votes
2
answers
19k
views
Invalid hook call while testing with jest - react native
I've got problem with testing screen. I'm trying to test with jest snapshot but first of all I wan't to pass simple test with RTK Query request API. In next example I try to get error something like ...
3
votes
2
answers
4k
views
RTK Query - How to implement inifinit scrolling and concatenate query results when using the pagination function?
I am trying to implement an inifinit scroll in my React Native application. My idea is to use a FlatList and when I reach the end of the list, the Page State is incremented so that Redux RTK refetches ...
0
votes
1
answer
1k
views
How to log and display partial data with RTK query?
I'm creating an mobile App with react native typescript and expo with help of rtk-query. I'm trying to get partial data from API https://pokeapi.co/api/v2/pokemon/snorlax/.
For example from API I'm ...