Closed radist2s closed 2 months ago
Latest commit: ebafaa23d5ddaa77a322e10067454240fcff2586
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.
TOptions
OR
To have the bot accept them for you, reply quoting the following line: @check-spelling-bot apply updates.
@raducal, thanks for the feedback, which motivated me to make this PR.
@radist2s Thank you, awesome stuff!
It would be cool if the baseUrl
and the requestFn
weren't required. Maybe in a future update, the baseUrl
and the requestFn
could be something we can pass to our createAPIClient
. It makes sense to make baseUrl optional if you go down this route in case a particular call required a different baseUrl
@raducal, this is exactly how the Vanilla client will be implemented.
The main problem with the inability to pass baseUrl
when calling createAPIClient(...)
for React is that then it will be necessary to pass the created client through React Context if we are talking about SSR support, for example in Next.js.
Also, for different cases, it may be necessary to somehow specify authorization headers that depend on the state. This would require re-creating the client for different cases, which is not optimal.
@radist2s I see. I think I would be totally ok with passing the client returned from createAPIClient
to the react context. Do you see any issues with that?
requestFn
on these invocable operations can also be left so users can handle headers and whatnot whatever way they would like to, but I think making it optional would be good since I think most of the time they would probably be handled the default way, which would be defined by the requestFn.
@raducal, thanks, there's a lot to think about here.
I would like to try to implement a type that would check whether specific parameters were passed, in order to make them optional, or require them to be passed when calling target functions.
Then, it would be possible to close the issue of the need to pass parameters and QueryClient
once and for all. True, I’m not sure that the resulting type will be optimal for a DX performance.
Added the ability to execute GET, POST, and other HTTP operations directly on OpenAPI endpoints via Qraft. This enhancement enables streamlined interaction with APIs, allowing users to configure parameters and base URL seamlessly.
Examples:
Fetching posts with specified limits:
Updating a post title using a post ID: