barnabasj
AEAsh Elixir
•Created by barnabasj on 7/13/2023 in #showcase
We created a small extensions for rbac policies
184 replies
AEAsh Elixir
•Created by barnabasj on 7/11/2023 in #support
Ambiguous Call during Compile because of Extension
I'm creating an extension and I tried adding an actions option to it, but it won't compile the resources anymore because it cant tell which actions function to use.
Extension definition:
35 replies
AEAsh Elixir
•Created by barnabasj on 6/22/2023 in #support
Postgres Queries have wrong where clause
Recently we some read actions do not return the correct data, the Queries that are logged have an obviously wrong where clause
The clause should be
c0."id" = ?
with the id in the parameter list
This is the resource and we query the current_user graphql query
We could also observe this behaviour when loading a has_one relationship
Versions:
ash: 06329b97cf531b6b585630638028233a48a7fa0b
ash_graphql: c70e7dec7dac1aac7fd40a67b51a6d61d67f9d41
ash_postgres: 9e31f905861c8f97bb2b54fd8604eb362391e67563 replies
AEAsh Elixir
•Created by barnabasj on 6/5/2023 in #support
get selected fields in create/update action
Hi, I have this policy to check if a user is only selecting fields that they are allowed to see. This worked well for reads because it was possible to get the selected/loaded fields from the query. Is it possible to do something similar for
mutations
97 replies
AEAsh Elixir
•Created by barnabasj on 5/26/2023 in #support
have the generator return values from a list (unique)
Hi,
I would like to use the generator functionality to create resources and I have a attribute with specific codes. I'm looking for a way to pass a generator that returns values from a list but does not return the same value twice in order for the unique constraint to work correctly.
2 replies
AEAsh Elixir
•Created by barnabasj on 5/15/2023 in #support
add ilike filter to graphql queries
Is it possible to extend the generated filter options in AshGraphql by e.g. an
ilike
filter?2 replies
AEAsh Elixir
•Created by barnabasj on 4/19/2023 in #support
no FunctionClause matching when loading calculation
Hi, somewhere between this commit de943509f73ff0c6ef3749feb3cc6ab6e4d99d2d and now, I started getting an error in one of my graphql queries.
I tried to look at it, but I wasn't able to figure it out yet.
It happens when the
:unkown
branch is executed here: https://github.com/ash-project/ash/blob/5005d57b1db3522a09accc6f10418ac230fe2c40/lib/ash/actions/read.ex#L1526
The context inside the query is empty and no action is set, therefore no run_query function matches.
The calulation it's trying to load is a simple expr
calulcation with a fragment
inside on a resource using AshPostgres Datalayer, no args
are anything.11 replies
AEAsh Elixir
•Created by barnabasj on 4/3/2023 in #support
Map type with specific field/values
Hi,
lately I've been creating more Graphql Mutations and I'm really missing a good way to type the arguments. I tried using embedded resources as types and that gave me nicely typed inputs but it did not work correctly as the underlying datastructure is a struct and all fields are always present, which lead to fields which were not being sent in the mutation being overwritten with nil.
Is there a way to create typed maps right now?
20 replies
AEAsh Elixir
•Created by barnabasj on 2/23/2023 in #support
Exposing data of the managed relationship
I created an action on Resource1 that creates another Resource2. Resource2 is created correctly using
manage_relationship
but I need to return the generated id for Resource2
and I have not found a way to get that information. Is it possible to access the return values from the action called by manage_relationship
? If they are accesible I could put them into metadata5 replies
AEAsh Elixir
•Created by barnabasj on 2/21/2023 in #support
no data in Ash.DataLayer.Simple
I have this action in one of my resources
I can see that ASh.DataLayer.Simple.set_data is called with the correct value, but I always get a
%Ash.Error.SimpleDataLayer.NoDataProvided
error back.
Not sure what I'm doing wrong
Thanks in advance13 replies
AEAsh Elixir
•Created by barnabasj on 2/21/2023 in #support
new ash_graphql version generates duplicate enums
I tried upgrading today from ash_graphql fbebb21d1867acf9d43ad09c56374ad98ea8594f to fbebb21d1867acf9d43ad09c56374ad98ea8594f (also latest commits on other ash libraries) and I was unable to compile.
I debugged a bit and was able to locate the problem here https://github.com/ash-project/ash_graphql/blob/0ecf70b54b78c6caa75d706ab4deacb214a3ee51/lib/resource/resource.ex#L2341
AshGraphql.all_attributes_and_arguments()
returns all fields including the fields of embedded types.
I have two fields descriptione_en
and description_de
both use the same embedded Type, the embedded type has a :boolean attribute with a one_of constraint.
AshGraphql now tries to define the type twice for each boolean field. This results in a compile Error inside of absinthe.
I was unsure on how to handle the embeded resources in that part of the code. The graphql enum should be defined for the embedded type I guess and not the one where it is embedded.6 replies
AEAsh Elixir
•Created by barnabasj on 2/3/2023 in #support
Recursive Flows
Hi I'm trying to right a flow that runs itself given a condition.
This leads to somekind of infinity recursion. I also tried copying the flow to a different file but that lead to an engine deadlock, it seems like the "sub" flow is run in the same context as the "parent" flow leading and as they both have the same step names it does not know which of the steps belong to which flow.
13 replies
AEAsh Elixir
•Created by barnabasj on 2/2/2023 in #support
Array of Arrays argument
Should it be possible to create an argument of type {:array, {:array, :integer}}? Right now I'm getting a compile error.
4 replies
AEAsh Elixir
•Created by barnabasj on 1/24/2023 in #support
Nested Embeds
Hi,
I'm trying to create a resource with nested Embeds
e.g.
But it seems Ecto cannot load structures like this If I understood this Issue https://github.com/elixir-ecto/ecto/issues/1256 correctly.
Is this just a limitation we have to live with?
6 replies
AEAsh Elixir
•Created by barnabasj on 1/24/2023 in #support
Compiler Warnings in Resources
Hi, I'm getting compiler warnings stating that I have unused aliases in my Resources but when I remove them I get compile errors because it can't find the module. Is it possible that this has something to do with how the resources get compiled?
5 replies