-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(svelte-query): specify readonly on create-queries options #7848
base: main
Are you sure you want to change the base?
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit d7b9a05. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 2 targetsSent with 💌 from NxCloud. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit d7b9a05:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7848 +/- ##
===========================================
+ Coverage 41.42% 88.27% +46.84%
===========================================
Files 184 18 -166
Lines 7331 162 -7169
Branches 1531 32 -1499
===========================================
- Hits 3037 143 -2894
+ Misses 3889 16 -3873
+ Partials 405 3 -402
|
The
queries
property in the first argument provided tocreateQueries
should have thereadonly
modifier.Minimum Reproduction
Expectation
A
readonly QueriesOptions<any>[]
and variations of this type should be compatible with thecreateQueries
function signature.Context
I'm writing a utility function that generates strongly typed query options, which will be plugged into
createQueries
directly. It looks something like this:The main points being that the function is generic, and returns a
readonly
tuple with strongly typed query options that are derived from the input generic. However, thereadonly
modifier is currently not compatible when usingcreateQueries
because thequeries
property is missing it...Other APIs
This is based on the types exported from react-query's useQueries, as well as solid-query's createQueries.