Writing a wrapper for useFetch

Hey!

We'd like to write some helper wrappers for useFetch (for example to call Ghost CMS endpoints for posts, or pages, all with their own composable abstracted.

I'm wondering how do you correctly type the fetch options? I just want to pass the type through

export default function useGhostData(url: string, options: UseFetchOptions) { // UseFetchOptions requires 6 params
  const runtimeConfig = useRuntimeConfig()

  return useFetch(`${runtimeConfig}${url}`, options)
}
Was this page helpful?