How do you folks deal with optional outputs? Let’s say I have a Person entity with :person/spouse attribute, which has no value until the person actually gets a spouse. Do I need to make my resolvers to return :person/spouse nil instead of not having the attribute at all in such cases? It works as is but I get the ugly error logs
> E 2023-03-26T08:36:35.028Z _rad.pathom3:- 31 - EQL query for :person/spouse cannot be resolved. Is it spelled correctly? Pathom error: {:com.wsscode.pathom3.error/cause :com.wsscode.pathom3.error/attribute-unreachable}
which I’d rather not have in my log. Thank you!
yeah, explicitly return nil if you explicitly know the value is nothing
Thank you!
Return ::pco/unknown-value instead of nil. Pathom will understand that the resolver was not able to provide that value.
If your query requires that value, then pathom will try and find it another way. Or if it’s optional in the query, then you have no issues
Pathom understands nil to be a valid result for that attribute if i recall
wonderful, thank you!