# 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
# 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