-
Hi, I'm trying to make this example work (following the guides). export const api = createApi({
baseQuery: fetchBaseQuery({ baseUrl: 'http://example.com/' }),
reducerPath: 'bills',
endpoints: (builder) => ({
getBills: builder.query<string, string>({
query: (value) => `foo/${value}`
}),
getBills2: builder.query<string, string>({
async queryFn(value : string) {
return { data: value }
}
})
})
})
api.endpoints.getBills.useQuery("foo");
api.endpoints.getBills2.useQuery("foo"); But somehow
Thanks for the great work and the help! |
Beta Was this translation helpful? Give feedback.
Answered by
phryneas
Feb 4, 2022
Replies: 1 comment 1 reply
-
Did you import from |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
ideco
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you import from
@reduxjs/toolkit/query
or@reduxjs/toolkit/query/react
? The hooks only exist on the latter.