Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat(react/fdc) add validateReactArgs for parsing arguments to variadic generated SDK query hook function signatures #174

Merged
merged 12 commits into from
Mar 25, 2025

Conversation

stephenarosaj
Copy link
Contributor

Previously, when queries were called from the generated React SDK, if options were being provided without a DataConnect argument (whether variables were required or not), options weren't being parsed properly and weren't passed to the underlying useDataConnectQuery function. This is because the generated TS signatures allowed for options to be provided as the second argument after vars, but at runtime the validateArgs function from the Core JS SDK only expects the two args to be dcOrVars and vars.

This PR adds a new function, validateReactArgs, which accounts for there being three arguments to parse (dcOrVars, varsOrOptions, and options) rather than just two.

Copy link

docs-page bot commented Mar 17, 2025

To view this pull requests documentation preview, visit the following URL:

docs.page/invertase/tanstack-query-firebase~174

Documentation is deployed and generated using docs.page.

@CLAassistant
Copy link

CLAassistant commented Mar 17, 2025

CLA assistant check
All committers have signed the CLA.

@stephenarosaj stephenarosaj changed the title feat(react/fdc) add for parsing arguments to variadic generated SDK query hook function signatures feat(react/fdc) add validateReactArgs for parsing arguments to variadic generated SDK query hook function signatures Mar 17, 2025
Copy link
Contributor

@maneesht maneesht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you format these files?

@Ehesp Ehesp merged commit 9587431 into invertase:main Mar 25, 2025
2 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants