Should resources with relationships spanning multiple Ash APIs be included in all registries
Hi folks,
I've introduced two Ash APIs (Accounts and Invoicing) with one resource each (
MyApp.Accounts.User
MyApp.Invoicing.Invoice
), and one registry for each API, each with the corresponding resource.
As I introduce the relationship where Invoice belongs_to
User and the inverse User has_many
Invoice, the ResourceValidations
extension started to complain :
Should each resource appear in both registries?
Thanks2 Replies
Nope! You just need to specify the
api
option when creating cross-api relationships and then it won’t require that you put it in the registry.Insane reactivity, thanks! This solved the error.
For reference, the relationship ends up looking like this :