Ash FrameworkAF
Ash Framework3y ago
56 replies
moxley

I'm trying to understand how to use attribute-based multitenancy with AshGraphql

1. The documentation says to set up a multitenancy block in your resource module, and add a strategy and attribute. Check:
  multitenancy do
    strategy :attribute
    attribute :org_id
  end


2. The documentation says to pass the tenant to the conn by calling Ash.PlugHelpers.set_tenant/2. Check:
def call(conn, _opts) do
  ...
  conn
  |> Ash.PlugHelpers.set_tenant(org)
  |> Ash.PlugHelpers.set_actor(session_resource)
end

Also, I inspected the above call to ensure it's being called correctly in my test.

So now in my test, I call the "create" mutation for my resource, and it returns the error "GF.Ash.WebComponent changesets require a tenant to be specified"

What am I missing?
Was this page helpful?