lolopinto / ent

MIT License
52 stars 6 forks source link

UpdateOperation data Map does not include actionOnlyFields #1764

Closed Swahvay closed 9 months ago

Swahvay commented 9 months ago

When using transformWrite, the data Map only includes fields defined on the schema. Obvious work around is to just use the input object.

lolopinto commented 9 months ago

i think this one is by design/wontfix

https://github.com/lolopinto/ent/blob/0b14f75ca8f10bca63ef42cfc6ed99bf39566d7f/ts/src/schema/schema.ts#L320-L330

// input. same input that's passed to Triggers, Observers, Validators. includes action-only fields 
   input: Data; 
   // data that'll be saved in the db 

maybe we need better documentation for this?

Swahvay commented 9 months ago

That's fine if it's by design. When would data ever be more than a subset of input? Does data include triggers or field formatters or something?

lolopinto commented 9 months ago

it includes default value for fields, formatted fields etc

what would be written to the database

Swahvay commented 9 months ago

Gotchya. Feel free to close/change this to an add documentation ticket/whatever you want. 👍