File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type Variables = { id: string };
88type Response = Post ;
99
1010export const usePost = createQuery < Response , Variables , AxiosError > ( {
11- queryKey : [ 'posts' ] , // we recommend using endpoint base url as queryKey
11+ queryKey : [ 'posts' ] ,
1212 fetcher : ( variables ) => {
1313 return client
1414 . get ( `posts/${ variables . id } ` )
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ type Response = Post[];
88type Variables = void ; // as react-query-kit is strongly typed, we need to specify the type of the variables as void in case we don't need them
99
1010export const usePosts = createQuery < Response , Variables , AxiosError > ( {
11- queryKey : [ 'posts' ] , // we recommend using endpoint base url as queryKey
11+ queryKey : [ 'posts' ] ,
1212 fetcher : ( ) => {
1313 return client . get ( `posts` ) . then ( ( response ) => response . data . posts ) ;
1414 } ,
You can’t perform that action at this time.
0 commit comments