Skip to content

Conversation

@onionhammer
Copy link

@onionhammer onionhammer commented Sep 3, 2024

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

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

@changeset-bot
Copy link

changeset-bot bot commented Sep 3, 2024

⚠️ No Changeset found

Latest commit: a0b55a4

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

@drwpow drwpow added the openapi-react-query Relevant to openapi-react-query label Sep 3, 2024
@onionhammer onionhammer marked this pull request as ready for review September 3, 2024 19:54
@onionhammer onionhammer requested a review from a team as a code owner September 3, 2024 19:54
@onionhammer onionhammer changed the title Add get key method and expose underlying client React-Query: Add getKey method Sep 3, 2024
@kerwanp
Copy link
Contributor

kerwanp commented Sep 17, 2024

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 kerwanp added the duplicate This issue or pull request already exists label Sep 17, 2024
@onionhammer
Copy link
Author

@kerwanp unless I'm missing it, I dont see a mechanism for getting a key from the PR you've referenced

@kerwanp
Copy link
Contributor

kerwanp commented Sep 20, 2024

@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

@onionhammer
Copy link
Author

Oh ok, that works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists openapi-react-query Relevant to openapi-react-query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support 'prefetchQuery' and 'invalidateKeys' on openapi-react-query

3 participants