Type Mismatch in Update Mutation with Optional Fields
schema.ts
accounts.ts
component
Error
Types of property 'name' are incompatible.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.
• In the mutation, I’ve excluded the type field and allowed the remaining fields to be updated.
• The handleUpdateAccount function uses Partial so only the fields that need updating are passed.
• I suspect the issue is that the mutation expects all fields to be required, but I’m passing optionals.
Is there a proper way to define the mutation to accept optional fields without manually marking each field as optional? Should I adjust the schema or is there a better solution to handle partial updates?
