srikanthkyatham
Hi
I hope I am rephrase my usecase. I have trimmed down for clarity sake. Let’s say that, I have a
defmodule ResourceA do
...
attributes do
attribute :date
end
end
ResourceB
defmodule ResourceB do
...
attributes do
attribute :methods, one_of: [:phone, :online]
end
end
ResourceC - whose job is get values from ResourceA and ResourceB and return it.
defmodule ResourceC do
...
code_interface do
define :overlap, args:[...]
end
actions do
action :overlaps, .. do
argument :start_date, :string, allow_nil?: false
argument :method, :atom, allow_nil?: false
run fn input, context ->
start_date = inputs.arguments.start_date
method = inputs.arguments.method
# gets overlaps from ResourceA and ResourceB
{:ok, result}
end
end
end
end
Now in the Doamin
defmodule Domain do
use Ash.Domain, extensions:[AshJsonApi.Domain]
resources do
...
end
json_api do
routes do
base_route "/overlaps", ResourceC do
route :get, "/overlaps", :overlaps
end
end
end
end
I am able to make the call. I can’t pass query params to the api call. I tried to debug but in vain. I am getting 400 error response. Any help is appreciated.
Thanks.
Trending in Discussions
Hey there,
It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
New
Hi there! :wave:
@frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
Other Trending Topics
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
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
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Showing Posts 1 to 7- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
In the code that I can see here, the action does not have
start_dateormethodarguments. Have you added those arguments to the generic action?zachdaniel
Also, when sharing errors etc. please share as much context, like what the response body was for the 400 error and if there are any logs indicating additional detail etc. Just 400 status could be many many things
srikanthkyatham
Hi
My bad. Yes the start_date and method are arguments for the action.
here is the response.
I have noticed that if I don’t pass the arguments as query parameters. I get the error saying that I am missing the arguments. If I pass the arguments they are not ending up in the Ash.run_action() call being made from the GenericActionRoute. I am not sure what I was missing.
zachdaniel
Hmm…it sounds like a bug? So
input.argumentsis an empty map?srikanthkyatham
Yes it is empty. I have noticed query_params is being populated in AshJsonApi.Request.parse_query_params, but it is relying on request.route. Not from request.query_params. I did not understand why it was done like that. I didnot dig deeper after that.
zachdaniel
Oh, right, did you set this? AshJsonApi.Resource — ash_json_api v1.7.0
i.e
… I think it is for post and other methods that could include a body and so require being told what is where. In the future we could probably assume that for get requests all of the inputs are query params.
query_params: [:start_date, :method]. I’m trying to remember why we require that to be setsrikanthkyatham
Oh I missed that. I got it working. Thanks stupid me. I should have gone through the options first