Skip to content
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

Functionality to construct partial record #111

Open
ericphanson opened this issue Jan 16, 2024 · 0 comments
Open

Functionality to construct partial record #111

ericphanson opened this issue Jan 16, 2024 · 0 comments

Comments

@ericphanson
Copy link
Member

If we have some subset of fields of a record whose construction/validation transformations do not depend on other fields, it would be nice to be able to construct the partial record (even as a NamedTuple or such) with this validation applied. For example, let's say the schema of interest is an Onda.SignalV2, and I only have the recording and file_format fields. It would be nice to be able to call the same code to run the constructor (e.g. call UUID on the recording field) for those fields, giving back a NamedTuple that represents the partial record.

This is handy for efficient interop with GraphQL, which allows only retrieving the fields you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant