BryanJBryce
I’ve got an app with multitenency and I’m trying to do a basic update on on resource via GraphQL using the default update action and I’m getting this error:
POST /gql
“superhotel.hotellite.local”
[debug] Processing with Absinthe.Plug
Parameters: %{“operationName” => “UpdateLodgingItem”, “query” => “mutation UpdateLodgingItem($updateLodgingItemId: ID!, $input: UpdateLodgingItemInput) {\n updateLodgingItem(id: $updateLodgingItemId, input: $input) {\n errors {\n code\n fields\n message\n shortMessage\n vars\n }\n result {\n checkInDate\n checkOutDate\n id\n name\n quantity\n rate\n subtotal\n tax\n taxRate\n total\n }\n }\n}”, “variables” => %{“input” => %{“checkInDate” => “2024-05-31”, “checkOutDate” => “2024-06-01”, “name” => “”, “paymentId” => “c252365d-b5c0-4b28-ad17-ccfb70b3d102”, “rate” => “100.0”, “taxRate” => “0.067”}, “updateLodgingItemId” => “0405f3b0-fe49-433d-8b7f-cc7c10b889bb”}}
Pipelines: [:graphql]
“Set tenant to superhotel”
[debug] ABSINTHE schema=App.GraphqlSchema variables=%{“input” => %{“checkInDate” => “2024-05-31”, “checkOutDate” => “2024-06-01”, “name” => “”, “paymentId” => “c252365d-b5c0-4b28-ad17-ccfb70b3d102”, “rate” => “100.0”, “taxRate” => “0.067”}, “updateLodgingItemId” => “0405f3b0-fe49-433d-8b7f-cc7c10b889bb”}
mutation UpdateLodgingItem($updateLodgingItemId: ID!, $input: UpdateLodgingItemInput) {
updateLodgingItem(id: $updateLodgingItemId, input: $input) {
errors {
code
fields
message
shortMessage
vars
}
result {
checkInDate
checkOutDate
id
name
quantity
rate
subtotal
tax
taxRate
total
}
}
}
[debug] QUERY ERROR source=“lodging_items” db=0.0ms queue=2.3ms idle=81.0ms
UPDATE “superhotel”.“lodging_items” AS l0 SET “payment_id” = s1.“payment_id”, “check_out_date” = s1.“check_out_date”, “check_in_date” = s1.“check_in_date”, “rate” = s1.“rate”, “tax_rate” = s1.“tax_rate”, “name” = s1.“name” FROM (SELECT $1::uuid AS “payment_id”, $2::date AS “check_out_date”, $3::date AS “check_in_date”, $4::decimal AS “rate”, $5::decimal AS “tax_rate”, $6::text AS “name” FROM “superhotel”.“lodging_items” AS sl0 WHERE (sl0.“id”::uuid = $7::uuid) LIMIT $8) AS s1 WHERE (l0.“id” = s1.“id”) RETURNING l0.“id”, l0.“name”, l0.“rate”, l0.“check_in_date”, l0.“check_out_date”, l0.“tax_rate”, l0.“payment_id” [“c252365d-b5c0-4b28-ad17-ccfb70b3d102”, ~D[2024-06-01], ~D[2024-05-31], Decimal.new(“100.0”), Decimal.new(“0.067”), nil, “0405f3b0-fe49-433d-8b7f-cc7c10b889bb”, 1]
↳ AshPostgres.DataLayer.update_query/4, at: lib/data_layer.ex:1411
[error] a85087ec-5abb-42a7-86d2-df0f5485f23d: Exception raised while resolving query.
** (Postgrex.Error) ERROR 42703 (undefined_column) column s1.id does not exist
query: UPDATE "superhotel"."lodging_items" AS l0 SET "payment_id" = s1."payment_id", "check_out_date" = s1."check_out_date", "check_in_date" = s1."check_in_date", "rate" = s1."rate", "tax_rate" = s1."tax_rate", "name" = s1."name" FROM (SELECT $1::uuid AS "payment_id", $2::date AS "check_out_date", $3::date AS "check_in_date", $4::decimal AS "rate", $5::decimal AS "tax_rate", $6::text AS "name" FROM "superhotel"."lodging_items" AS sl0 WHERE (sl0."id"::uuid = $7::uuid) LIMIT $8) AS s1 WHERE (l0."id" = s1."id") RETURNING l0."id", l0."name", l0."rate", l0."check_in_date", l0."check_out_date", l0."tax_rate", l0."payment_id"
hint: Perhaps you meant to reference the column "l0.id".
(ecto_sql 3.11.2) lib/ecto/adapters/sql.ex:1054: Ecto.Adapters.SQL.raise_sql_call_error/1
(ecto_sql 3.11.2) lib/ecto/adapters/sql.ex:952: Ecto.Adapters.SQL.execute/6
(ecto 3.11.2) lib/ecto/repo/queryable.ex:232: Ecto.Repo.Queryable.execute/4
(ash_postgres 2.0.6) lib/data_layer.ex:1411: AshPostgres.DataLayer.update_query/4
(ash 3.0.8) lib/ash/actions/update/bulk.ex:442: Ash.Actions.Update.Bulk.do_atomic_update/5
(ash 3.0.8) lib/ash/actions/update/bulk.ex:231: Ash.Actions.Update.Bulk.run/6
(ash_graphql 1.0.1) lib/graphql/resolver.ex:1224: AshGraphql.Graphql.Resolver.mutate/2
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:234: Absinthe.Phase.Document.Execution.Resolution.reduce_resolution/1
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:189: Absinthe.Phase.Document.Execution.Resolution.do_resolve_field/3
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:174: Absinthe.Phase.Document.Execution.Resolution.do_resolve_fields/6
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:145: Absinthe.Phase.Document.Execution.Resolution.resolve_fields/4
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:88: Absinthe.Phase.Document.Execution.Resolution.walk_result/5
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:67: Absinthe.Phase.Document.Execution.Resolution.perform_resolution/3
(absinthe 1.7.6) lib/absinthe/phase/document/execution/resolution.ex:24: Absinthe.Phase.Document.Execution.Resolution.resolve_current/3
(absinthe 1.7.6) 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.12) lib/phoenix/router/route.ex:42: Phoenix.Router.Route.call/2
(phoenix 1.7.12) lib/phoenix/router.ex:484: Phoenix.Router.__call__/5
(app 0.1.0) lib/app_web/endpoint.ex:1: AppWeb.Endpoint.plug_builder_call/2
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
Hello,
I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter).
The diffic...
New
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
Anyone here using Honeybadger?
My Honeybadger account is being overwhelmed with noise from some bots. Seeing a lot of
Bandit.HTTPError...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
Other Trending Topics
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
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
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
There are three potential reasons for members of this forum to have a look at https://vutuv.de
You are tired or annoyed of LinkedIn.
Yo...
New
Aludel - LLM Evaluation Workbench
Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
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
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixir-ls
- #ai
- #elixirconf-us
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 9- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
zachdaniel
Can you ensure that you’re fully updated on both ash and ash_postgres?
BryanJBryce
Pretty sure I am, but I’ll double check
BryanJBryce
I did a
mix cleanandmix deps.clean --allfor good measurezachdaniel
BryanJBryce
I’ll dig a little more and try to repro on a basic app as well
BryanJBryce
I just tested destroy and it works, so I’m guessing it’s only in the update code, still digging…
zachdaniel
Should be fixed in latest ash_postgres main, thanks
BryanJBryce
@zachdaniel Confirmed it’s fixed on that sample project, but my project with multitenancy is still broken, I think that the schema isn’t being used?
The table name is
lodging_itemsbut with the schema added on it should besuperhotel.lodging_itemsI’ll create a repro example from that basic one and open another issue.
BryanJBryce
Hrm, the sample project didn’t reproduce, could be a bug on my end