Open OwenVey opened 4 weeks ago
In my case, the OMDb API required an apikey query param passed in every request so I set up my createFetch like so:
apikey
createFetch
export const omdbApi = createFetch({ baseURL: 'http://www.omdbapi.com', query: { apikey: 'xxxxxxxx', }, schema: createSchema( { '/': { query: z.object({ i: z.string(), }), }, }, ), });
However, when calling the API like so
omdbApi('/', { query: { i: 'tt22022452'} })
only the i query param gets sent.
i
I think you can use the onRequest hook.
Docs: https://better-fetch.vercel.app/docs/hooks#on-request 🤟
In my case, the OMDb API required an
apikey
query param passed in every request so I set up mycreateFetch
like so:However, when calling the API like so
only the
i
query param gets sent.