Fork me on GitHub
Mark Wardle19:07:05

I made a mistake with modelling some to-one relationships in my pathom resolvers, which means that, when that relationship doesn't exist, I get a nil ident in my client-side database. Flattening these attributes into the parent entity fixes the issue, but is there an alternative approach? Can I safely ignore these nil idents or will I get weird problems later?

Mark Wardle19:07:59

e.g. I have [:patient/identifier :patient/date_birth {:patient/death_certificate [:death-certificate/part1a :death-certificate/part1b]}]

Mark Wardle19:07:16

Works perfectly if the resolver returns a value for the to-one relationship, but if it is missing, I get a nil ident. e.g. see :t_summary_multiple_sclerosis/id

Jakub Holý (HolyJak)19:07:45

I am lazy and typically do not care about this nil idents 😅 Are they an aesthetic, or actual problem for you?

Mark Wardle11:07:00

Purely aesthetic at this point, although seeing nil values when I was first starting out usually meant I was doing something quite wrong. So thank you - helpful to know you ignore them.

👍 1