Ash FrameworkAF
Ash Framework6mo ago
8 replies
Ty.nielson123

Subscriptions return all data regardless of tenant

I am running into an issue where all data is returned by a subscription even when multi-tenancy is set up.

I have a product resource that belongs to an organization. The tenant attribute is the organization_id on the product. When creating a product, all subscribers receive the data including for products outside their tenant.

# in the product resource
graphql do
  type :product
  subscriptions do
    pubsub MyApp.Endpoint

    subscribe :product_created do
      action_types :create
      read_action :read
    end
  end
end

actions do
  defaults [:create, :read, :update, :destroy]
  default_accept [:name]
end

multitenancy do
  strategy :attribute
  attribute :organization_id
end

relationships do
  belongs_to :organization, MyApp.Accounts.Organization do
    public? true
  end
...
end


Is this behavior not implemented yet or is this a bug?
Was this page helpful?