patch(return types): union return type with undefined.#33
Merged
7nohe merged 4 commits into7nohe:mainfrom Jan 3, 2024
Merged
Conversation
nemomichael
approved these changes
Jan 2, 2024
86bac1b to
4beef64
Compare
React query data is undefined by default. Previously we were overriding the default type of react query. Now union with undefined. We are also exporting the data type.
4beef64 to
b0f2f6d
Compare
Owner
|
@seriouslag Thank you for the PR! Everything looks good 👍🏼 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
React query data is in union with undefined by default.
Previously, we were overriding the default data type of react query.
This causes the issue where the default return type was never marked as undefined.
It should always be possible for the default data to be undefined.
Now we union with undefined.
Exporting the default return type, closes #32
Re-did some of the typings to make it easier to change types.
Added to the example showing how to override the return type for the data, which was addressed in #29
Now, the generator passes the open API descriptions as JSDoc comments to the generated hooks and marks the methods as depreciated if marked in the spec. This closes: #18
Showing undefined listed in union on return type (as react query would do)

New JSDoc:

With deprecated indicator:

Exporting helper types for consumers if they need: