Skip to content

Conversation

PietervdWerk
Copy link

Changes

Add setQueryData helper to openapi-react-query for type-safe setting of query data as discussed in #1806, as proposed by @ShoeBoem

I think a typesafe invalidateQueries is also a nice addition, and I'd be more then happy to add it to this or a new PR.

Disclaimer:
I have used AI in the making of this PR to understand, research and document the feature (GPT 4.1). I have validated the results myself and am satisfied with code quality, tests and type safety and feel confident that this is a nice step forward for the package.

How to Review

I've added an example project to play around with the typesafety of the setQueryData function on the api client.

Checklist

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

@PietervdWerk PietervdWerk requested a review from a team as a code owner September 3, 2025 20:46
@PietervdWerk PietervdWerk requested a review from kerwanp September 3, 2025 20:46
Copy link

changeset-bot bot commented Sep 3, 2025

🦋 Changeset detected

Latest commit: e8a2f2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
openapi-react-query Minor
openapi-react-query-setquerydata-example Patch

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

Copy link

netlify bot commented Sep 3, 2025

Deploy Preview for openapi-ts failed.

Name Link
🔨 Latest commit e8a2f2f
🔍 Latest deploy log https://app.netlify.com/projects/openapi-ts/deploys/68b9859625cf7e0008289b5f

@gzm0 gzm0 added the openapi-react-query Relevant to openapi-react-query label Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openapi-react-query Relevant to openapi-react-query
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants