You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Absinthe version: pinned at sha: "738f97b96d77f793a99098aa9008683d9b6ab991" in our service, however, also validated that this occurs in Absinthe 1.7.0
Expected behavior
I would expect the execution of the following query containing a field aliased with the same name as a field of incompatible type to error: query { thing(id: "foo") { otherThing: name otherThing { name } } }
Instead, the aliased field is simply omitted from the response as follows: {:ok, %{data: %{"thing" => %{"otherThing" => "Foo"}}}}
Environment
sha: "738f97b96d77f793a99098aa9008683d9b6ab991"
in our service, however, also validated that this occurs inAbsinthe 1.7.0
Expected behavior
I would expect the execution of the following query containing a field aliased with the same name as a field of incompatible type to error:
query { thing(id: "foo") { otherThing: name otherThing { name } } }
Instead, the aliased field is simply omitted from the response as follows:
{:ok, %{data: %{"thing" => %{"otherThing" => "Foo"}}}}
Relevant thread in #absinthe-graphql: https://elixir-lang.slack.com/archives/C0PR49P4P/p1644946451423759 that points to the spec for this case.
Relevant Schema/Middleware Code
I traced this issue to Absinthe.Resolution.Projector.project/5, which is where field selections are collected by using either the alias or field name as the key in the accumulator here: https://github.com/absinthe-graphql/absinthe/blob/master/lib/absinthe/resolution/projector.ex#L52.
The text was updated successfully, but these errors were encountered: