Home > front end >  how to test your react toolkit query with console.log
how to test your react toolkit query with console.log

Time:10-24

i am writing my first rtk query and i want to test if my query is working or not what is the best solution for testing my query in console tab

export const search = createApi({
  reducerPath: 'search',
  baseQuery: fetchBaseQuery({ baseUrl: myURL }),
  tagTypes: ['search'],
  endpoints: (builder) => ({
    getSearch: builder.mutation<searchDataRes, string>({
      query: ({ keyword }: any) => ({ url: /Post, method: 'GET' })
    })
  }),

CodePudding user response:

Download the Redux Devtools and look at those - you will be able to observe pretty much everything there. Also, take a look at your network tab.

  • Related