sezaru
When calling password_reset_with_password from AshGraphQL it will fail since the update mutation expects me to be logged.
Calling the action directly from IEX works fine.
Here is how I added it to my graphql block:
graphql do
...
mutations do
update :password_reset_with_password, :password_reset_with_password do
identity false
end
...
end
end
This is how I’m calling it:
passwordResetWithPassword(
input: {
password: "12345678"
passwordConfirmation: "12345678"
resetToken: "my reset token"
}
) {
metadata {
token
}
result {
fullName
email
}
errors {
message
}
}
From the terminal, I get this error:
SELECT u0."id", u0."email", u0."hashed_password", u0."phone_number", u0."first_name", u0."surname", u0."roles", u0."organization_roles", u0."confirmed_at", u0."active?", u0."referral_code", u0."normalized_full_name", u0."inserted_at", u0."updated_at", u0."organization_id", u0."created_by_id", u0."referred_by_id" FROM "users" AS u0 []
[warning] `1a4e5e6f-8131-42b8-bcdb-bc3e71bc818b`: AshGraphql.Error not implemented for error:
** (Ash.Error.Invalid.MultipleResults) expected at most one result but got at least 15.
Please ensure your action is configured with an appropriate filter to ensure a single result is returned.
(ash 2.14.17) lib/ash/api/api.ex:1948: Ash.Api.unwrap_one/1
(ash 2.14.17) lib/ash/api/api.ex:1930: Ash.Api.unwrap_one/1
(marketplace 1.3.2) lib/marketplace/accounts.ex:1: Marketplace.Accounts.read_one/2
(ash_graphql 0.26.6) lib/graphql/resolver.ex:1137: AshGraphql.Graphql.Resolver.mutate/2
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:234: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:189: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/3
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:174: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:145: Absinthe.Phase.Document.Execution.Resolution.resolve_fields/4
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:88: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:67: Absinthe.Phase.Document.Execution.Resolution.perform_resolution/3
(absinthe 1.7.5) lib/absinthe/phase/document/execution/resolution.ex:24: Absinthe.Phase.Document.Execution.Resolution.resolve_current/3
(absinthe 1.7.5) lib/absinthe/pipeline.ex:408: Absinthe.Pipeline.run_phase/3
(absinthe_plug 1.5.8) lib/absinthe/plug.ex:536: Absinthe.Plug.run_query/4
(absinthe_plug 1.5.8) lib/absinthe/plug.ex:290: Absinthe.Plug.call/2
(phoenix 1.7.9) lib/phoenix/router/route.ex:42: Phoenix.Router.Route.call/2
(phoenix 1.7.9) lib/phoenix/router.ex:432: Phoenix.Router.__call__/5
(marketplace 1.3.2) lib/marketplace_web/endpoint.ex:1: MarketplaceWeb.Endpoint.plug_builder_call/2
(marketplace 1.3.2) deps/plug/lib/plug/debugger.ex:136: MarketplaceWeb.Endpoint."call (overridable 3)"/2
(marketplace 1.3.2) lib/marketplace_web/endpoint.ex:1: MarketplaceWeb.Endpoint."call (overridable 4)"/2
(marketplace 1.3.2) lib/marketplace_web/endpoint.ex:1: MarketplaceWeb.Endpoint.call/2
(phoenix 1.7.9) lib/phoenix/endpoint/sync_code_reload_plug.ex:22: Phoenix.Endpoint.SyncCodeReloadPlug.do_call/4
(plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
(cowboy 2.10.0) /home/jeferson/workspace/rebuilt/platform/marketplace/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
(cowboy 2.10.0) /home/jeferson/workspace/rebuilt/platform/marketplace/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
(cowboy 2.10.0) /home/jeferson/workspace/rebuilt/platform/marketplace/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
(stdlib 5.0.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Seems like it is trying to find a user, but since I’m not logged (I mean, I’m resetting the password, so I can’t be logged first since I don’t know the initial password anyway), it will just query the full users table without a filter.
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello,
I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
Hi everyone,
I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding.
I sta...
New
Documentation
While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
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
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 there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hi everyone!
The first release candidate for the Expert language server project is now available!
We’ve published a press release detai...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
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
- #ecto-query
- #ai
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #elixirconf-eu
- #metaprogramming
- #hex










Showing Posts 7 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
sezaru
Thanks! That worked great!
zachdaniel
Okay, gotcha, so, set
identity :unique_email(or whatever the identity is that users use to log in).sezaru
Yes, by default it does support the id input, but I disable it with the
identity falseoption.It is as you said, you shouldn’t need to have to fetch the user to run this action since the whole point is to actually reset the password of an account that you don’t currently have access to.
In any case, here is the action schema
zachdaniel
Ah, sorry I’m looking for the graphql schema. Like if you load up the explorer or something like that, I was looking for whether or not it supports an
idinput, because it should, I think.EDIT: actually, thinking about this, that doesn’t make sense. It would need to look up a user by email. Might need a consult from @jimsynz on this one.
sezaru
Just for completness, before what I did to fix this was to create the graphql mutation by hand like this:
In this case I’m using
AshAuthentication.Strategy.Password.Actions.resetinstead of thepassword_reset_with_passwordaction. But I want to remove this code and just use AshGraphql + AshAuthentication directly in my resource.sezaru
It is just the default action
AshAuthenticationcreates when we use the password strategy, here is the generated schema:The only difference from the original is that I added these two changes to it:
But these, I believe, should not change anything regarding the error I’m getting.
zachdaniel
This is pretty strange. With that default setup it should be requiring an
idinput…what does the generated schema for that action look like?