barnabasJ
Ash Core Team
New AshGraphql Feature: Subscriptions
You can now add subscriptions using the DSL.
subscriptions do
pubsub YourAppWeb.Endpoint
subscribe :something_changed do
action_types [:create, :update, :destroy]
end
end
Right now, you still need to add the dependency from github. A release will follow soon.
I created a small demo video showing the setup.
Trending in News & Updates
I’m a bit excited to announce that Localize and friends are now at release 1.0. Even though it’s a 1.0 release, it stands on 8 years of w...
New
After building Hologram and sharing updates across various places, I’ve realized there’s a lot happening that doesn’t always make it to t...
New
Just published search_ash 0.5.0 (with search_core 0.4.0) on Hex.
What’s new: synonyms
You can now declare a synonym dictionary per lang...
New
After years of struggling I made StreamData dependency optional.
Finitomata.ExUnit got testing primitives for Persistence.
Full back co...
New
We have released v0.13 of nx, exla and torchx, along with a recently released emlx v0.4.
Nx
This is where the bulk of the updates happen...
New
Hologram v0.11 is out! Two headline features this release. First, Elixir regexes now run in the browser. They were server-only until now,...
New
ActiveMemory 0.8.0 is on Hex. It’s an in-memory store built on ETS and Mnesia:
typed records you query by **any attribute**, not just a ...
New
Other Trending Topics
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #elixirconf-us
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #hex
- #performance










First 5 of 5 Posts
sezaru
Amazing work! I will try it out asap!
Off-topic: I noticed that around 6:10 of the video, you saved a Ash resource and the formatter changed the resource code blocks order. How did you do that?
sezaru
Also, another question.
Can you somehow add logic to filter out data based on some criteria?
For example, let’s say I have a resource that contains data for multiple organizations, I want to subscribe to that resource actions, but I don’t want it to allow an me to subscribe to all data from all organizations for that resource, only for the ones that are from my own organization.
zachdaniel
What you subscribe to is a query built for a read action, so that read action can contain filters. Additionally, if you have policies that filter the data, they will be applied to all data before a notification is sent.
zachdaniel
That is the
Spark.Formatterplugin. You can configure it to set a section order for any Spark DSL includingAsh.Resource.bastiW
Minimal Reproduction example
Including
https://github.com/bastiW/my_subscription_app_sqlite
In the meanwhile you can skip most steps shown in the Video. As the CLI is doing that for you. You just need to run some cli commands and then modify the resource
If you want to start from scratch you can run:
Setup new project (I think the commands provide on the ash-hq site would also work)
Create a resource
Modify the post resource:
https://github.com/bastiW/my_subscription_app_sqlite/blob/main/lib/my_subscription_app/posts/post.ex
Switch from simple GraphQL interface to playground - as the simple seem to not support the subscriptions:
https://github.com/bastiW/my_subscription_app_sqlite/commit/5542ffc7770475b4443a60792ba886fbeb2a7b86