rtk-query Questions

1

Solved

I came across useAppSelector while using redux with RTK query. So what will be the difference between useSelector and useAppSelector gonna be or both works in the same way?
Labdanum asked 14/8, 2022 at 15:11

1

Solved

I'm learning about RTK Query and really confused. I'd be happy if someone could point me towards the right direction. My question is how one can manipulate the state of the application store the sa...
Forster asked 8/8, 2022 at 15:58

1

Solved

Is is possible to get the response of endpoint in React RTK Query Mutation . I have a one mutation which insert into DB and I need to get the ID which inserted. in my api : addRecord: build.mutatio...
Arvo asked 1/8, 2022 at 9:2

1

Solved

In the documentation of the RTK query, this is the introduction that is provided to the fetchBaseQuery util: This is a very small wrapper around fetch that aims to simplify requests. It is not a f...
Roughen asked 30/7, 2022 at 15:22

1

I'm completely new to using RTK Query, I created the app before but without the authentication and everything worked, now I want to add the authentication using Auth0 but I can't access any file I ...
Dasi asked 11/4, 2022 at 18:42

0

I'm creating a pet project with React with Redux on the front end and Node.js with express on the back end. It's the first time I use Redux and RTK Queries, and I'm confused about cookies not being...
Yuri asked 14/6, 2022 at 20:1

2

I created the endpoint with createApi: export const postsApi = createApi({ reducerPath: 'postsApi', baseQuery: fetchBaseQuery({baseUrl: 'https://jsonplaceholder.typicode.com/'}), tagTypes: ['Pos...

1

Solved

Having a hard time finding a good answer/ solution for this problem. I have a POSTS list component that allows to delete individual POST rows. I'm using a run of the mill queryMutation for deletion...
Matheny asked 31/5, 2022 at 10:10

2

Solved

Im using Material UI's datagrid to show some data in a table, I recently switched over to RTK query from redux for caching and to get rid of the global state management in the project but encounter...
Unpile asked 15/4, 2022 at 20:9

1

Solved

I'm new in RTK Query and I'm struggling with a use case I have to implement. Scenario: I have to merge the results from two API calls: the first API call is a private API call while the second one ...
Hydrosome asked 29/4, 2022 at 9:49

3

Solved

What will happen when i use Redux Toolkit Query with redux-persist? Will it use the persisted state or will the state be refetched?
Katlin asked 11/6, 2021 at 21:57

1

Solved

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 lik...
Amusement asked 21/3, 2022 at 13:43

1

I'm trying to use RTK Query in currency-converter app. This app is based on 2 API. First, I'm fetching an object with currencies. Then, I'm fetching an array of countries and filter it, depending w...
Klee asked 24/12, 2021 at 10:2

1

Solved

Following is my implementation of the useLazyQuery hook: const [trigger, { loading: prodLoading, error: prodError, data: prodData } ] = prodApi.endpoints.getAllProducts.useLazyQuery(); wh...
Baghdad asked 27/2, 2022 at 8:27

1

Solved

Hello all and thanks in advance. Just to begin with, I am aware that weather data is not a suitable use case for RTK Query as it is always changing, I am using RTK Query in this case just for pract...
Quesenberry asked 23/2, 2022 at 3:38

1

Solved

I'm trying to set up cache invalidation for my project with RTK Query, but I get a type error when following the official documentation. The goal is to invalidate individual items in the fetched li...
Luhey asked 15/2, 2022 at 9:34

1

Solved

I'm in the process of implementing rtk-query and am having problems with the polling feature of the library. ### service.js export const api = createApi({ ..., endpoints: (builder) => ({ getB...
Wightman asked 3/2, 2022 at 16:43

2

Solved

I have an RTK Query mutation endpoint rejectApplication, that invalidates the getApplication query. These are in the same API. rejectApplication: builder.mutation<RejectResponse, string>({ q...
Raccoon asked 8/12, 2021 at 11:36

1

Solved

I use rtk query and I want to pass header authentication for all of request except refresh token without header and this is my code is there a way to have condition or pass header to be empty? or c...
Undressed asked 10/1, 2022 at 6:44

1

Solved

Don't know how to access the headers after the request. Documentation examples without using x-total-count const guitarApi = createApi({ reducerPath: 'GUITARS', baseQuery: fetchBaseQuery({ baseUr...
Downward asked 19/12, 2021 at 1:22

2

Solved

I've successfully written my application using Axios to fetch content. As of now, it's set up to fetch content when certain events happen (like the submit button has been clicked.) However, I'm exp...
Glidewell asked 8/9, 2021 at 1:37

1

const renderItem = ({ item }: {item : siteDataCard}) => { return ( <SiteCard key={item.key} siteName = {item.siteName} status={item.status} alarmCount ={item.alarmCount} siteCapacity ={it...
Minority asked 8/10, 2021 at 17:9

1

Solved

how to disable prepareHeaders on specific endpoint?, for example, i dont need authorization header on login or register endpoint, but on some endpoint i need authorization headers. export const ba...
Tantivy asked 16/11, 2021 at 12:38

1

Solved

I tried to use the RTK query on my login request, but I got some trouble when printing out the result. Here is my code. authRTK.ts import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/q...
Glottochronology asked 6/11, 2021 at 1:44

1

I have migrated towards RTK and enjoying it immensely so far, but one thing I got stuck on is the following situation: We have (for keeping it simple's sake) two endpoints: www.domain-customer.com...
Brownlee asked 8/10, 2021 at 8:58

© 2022 - 2024 — McMap. All rights reserved.