Repository navigation
Is it possible to "Pick" a subset of properties into a model? #3484
Closed
Elliot Shepherd (elliots)
started this conversation in
Ideas
Replies: 2 comments 4 replies
|
We don't have Pick yet unfortunately. We have Omit, though it's done with a mutating decorator which is questionably good. That said, you could look at how that works and implement something similar for Omit. Alternatively, you can pull out e.g. id and weight into a separate model and spread it in where needed. |
4 replies
|
The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The usecase is that we have models that are used by different apis, sometimes with only a subset of the properties. For example, emitting CustomerCreated events to a webhook that only include id, name, email from Customer.
I could create BaseCustomer and have multiple things extend it, but maybe there's another way?
e.g.
All reactions