How to make 'actor' available in nested forms' action
Ash.set_actor(current_user) in the
mount function of a liveview that contains a nested form. The create/update actions of the main (posts) and sub form (comments), both of which includes
change fn changeset, %{actor: actor}, the variable
actor passes the proper user map for
post , but nil for
comment`. Also tried passing actor like below, but it didn't help either. Is there anything else I need to do to make it available in the nested forms' action as well?
```
AshPhoenix.Form.for_update(post, :update,
api: MyPosts,
actor: socket.assigns.current_user,...st_distance vs <-> in ash_geo for nearest neighbor search/filter (knn)
ash_geo
and attempting to implement a knn filter, as described here:
https://postgis.net/workshops/postgis-intro/knn.html
Unlike a distance search, the “nearest neighbour” search doesn’t include any measurement restricting how far away candidate geometries might be, features of any distance away will be accepted, as long as they are the nearest....
How to sort on a postgres regex?
GraphQL API fails if custom type is not allowed via a field_policy
null
, all the other fields normally (assuming they are not forbidden as-well) and an error in the errors list telling that this field is forbidden.
But, if I try the same with a custom type, then I just get the full result as null:
```json...Postgres reference with non-"id" primary keys
How to use fragments and not built-in predicates in Ash.Filter keyword list syntax?
Ash.Filter
keyword list syntax with built-in predicates, how can I use it with fragments or non-built-in predicates?
For example, this filter:
```elixir...parse filter with fields from another resource relationship
Ash.Filter.parse/2
to generate filters using the list syntax, for example:
```elixir
Ash.Filter.parse(Template, [
or: [...Ash.Resource.ManualRead And Filters
Ash.Resource.ManualRead
. Reading the data is not a problem, but as the REST API is way less capable for filtering, I would like to run the returned data through the Ash filters I applied to the query. I mapped the returned data already to the Ash resource and now have an array of these resources. But how can I now apply the filters from the query? That’s what read!()
normally would do, but calling that would lead to...Group by and count query
Creating an Identity referencing a key within a :map attribute (postgres-stored jsonb)
Do I have to manually make a `node` query in Absinthe to honor Global Object Identification?
graphql, queries, list
with relay?: true
per the docs:
https://ash-hq.org/docs/dsl/ash-resource#graphql-queries-list-relay-...Postgrex error when creating record with AshGeo type
Suggestion broken with latest ElixirSense
GraphQL NewType Non-null?
allow_nil?
s into constraints
key. Am I holding it wrong?
```elixir
defmodule MyApp.Types.LatLng do
use Ash.Type.NewType,...
Filtering by enum attribute
status
. Im using AshJsonApi to pass in a filter: filter[status]=active,incomplete
. This doesnt seem to work out of the box so I implemented a preperation where I do this:
```elixir
defp filter_by_status(query) do
case Ash.Changeset.get_argument(query, :filter) do
%{"status" => statuses} ->...Notifications warning in migration
[warning] Missed 1 notifications in action GF.WebComponents.WebSite.update
in the logs when running a new migration that calls an :update
action on a resource. I know very little about Ash notifications and how they work. I don't want to disable them globally, because they might be useful in the future. How can I prevent this warning from appearing when the migration runs?
```
12:39:17.050 [warning] Missed 1 notifications in action GF.WebComponents.WebSite.update.
...Is there a way to define dsl for new type of attribute?
type
and default
to uuid_primary_key
. But wanted to venture into making a small spark extension that adds ulid_primary_key
.
With my naive approach I wrote something like that:
```elixir
defmodule Ash.Ulid.Extension do...Duplicate input types for GraphQL
Create action commits changes even if return fails due to field policy
fields
field policy inside my rbac rules. Because of that, when I run the create action from that resource, it will fail with this error when returning the value:
```...