Ash FrameworkAF
Ash Framework3y ago
22 replies
axdc

No Such Relationship

I have a many_to_many relationship between Plan and Post. Plan is the source, the relationship is defined there. Post is the destination. PlansPosts is the join resource. It's all in the same api this time. I'm making a form with, and calling manage_relationship from, Post, and that's resulting in a Spark error:
** (EXIT from #PID<0.95.0>) an exception was raised:
    ** (Spark.Error.DslError) [Panacea.Sites.Post]
 actions -> create -> commander_create -> change -> manage_relationship -> relate_plans -> plans:
  No such relationship plans exists.
        (ash 2.7.1) lib/ash/resource/transformers/validate_manage_relationship_opts.ex:40: anonymous fn/3 in Ash.Resource.Transformers.ValidateManagedRelationshipOpts.transform/1


I based this relationship on my existing, working, cross-api many_to_many SitesUsers, and I've run through the relationship guide a few more times to check if I'm missing anything from recent updates. Nothing is jumping out at me yet.

Am I meant to be able to use relationships in actions on destination resources and not just source resources? That's the only difference that immediately comes to mind compared to the SitesUsers relationship that works.

This error persists after mix clean --all, mix deps.update ash (still using
main
), etc
Was this page helpful?