Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

types(OptionalRestArgs): truly only require args input when necessary #59

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

Open
NamesMT wants to merge 1 commit into get-convex:main
base: main
Choose a base branch
Loading
from NamesMT:optionalArgs

Conversation

@NamesMT
Copy link
Contributor

@NamesMT NamesMT commented Jul 17, 2025
edited
Loading

Currently args are still required even though all of it's properties are optional, this change adds IsOptionalKey and AreAllPropertiesOptional util types, and use it to achieve "truly necessary requirement only" of args.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Collaborator

This is a nice change but we're thinking we want to go the other direction here: we've found it gets complicated to write client-side middleware when it's all conditional on these optional types and would like to move to always requiring args.

This change doesn't make the situation any worse, so I'd like to take it, but it does cause some additional work for wrapping code like convex-helpers that hardcodes the exact optional approach used today.

Hold onto this for when we try out a single-object API for useQuery more like https://tkdodo.eu/blog/the-query-options-api; I think that would give us better separatioe between plumbing layers where middleware needs to e.g. insert an argument or consume an argument and the top usage layer where we can do things like this.

Let's not close this yet, when Ian gets back from PTO we can check, but I think this is the kind of thing that will cause type thrash and we wont' be stuck with it for too much longer.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /