openapi-typescript
openapi-typescript copied to clipboard
React-Query: Add getKey method
Changes
Adds support for getting a react query key in the same format this library generates the keys
Fixes #1898
How to Review
How can a reviewer review your changes? What should be kept in mind for this review?
Checklist
- [x] Unit tests updated
- [x]
docs/updated (if necessary) - [ ]
pnpm run update:examplesrun (only applicable for openapi-typescript)
⚠️ No Changeset found
Latest commit: a0b55a43df051b05b6023c1a4591dc1a78bdd981
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Hi @onionhammer and thanks for willing to contribute!
Unfortunately, it seems that your PR as the same goal as the already opened https://github.com/openapi-ts/openapi-typescript/pull/1858/files wich as already been discussed in previous issues.
If it is the case, feel free to leave a thumbs up on the PR so we know that it is a requested feature and close this one.
@kerwanp unless I'm missing it, I dont see a mechanism for getting a key from the PR you've referenced
@kerwanp unless I'm missing it, I dont see a mechanism for getting a key from the PR you've referenced
The queryOptions method allows you to generate the queryOptions. So you can use it to generate the queryKey:
$query.queryOptions('get', '/api/posts').queryKey
Oh ok, that works