Query-native
Returns data, throws FetchError, honors signal — drop straight into useQuery / queryOptions.
By Mohammad Garmabi · Tiny HTTP core · typed errors · AbortSignal · SSR · SSE · tRPC — built for the queryFn mental model.



All npm packages by Mohammad Garmabi →
![]() | ![]() |
![]() | ![]() |
![]() | ![]() |
import { createFetch } from 'tanstack-fetch'
import { useQuery } from '@tanstack/react-query'
const api = createFetch({ baseUrl: 'https://api.example.com' })
useQuery({
queryKey: ['users'],
queryFn: ({ signal }) => api.get<User[]>('/users', { signal }),
})