-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix the build_payload #11
Conversation
Can you add a test to see what was the problem with the behaviour before your changes? We run |
Hi, @simonprev , writing a test to show the problem is hard, but I know why the |
You can check this test to reproduce the problem. They are the same logic, but the first test not work, and the second works. The difference is the first uses So, I think the problem is we need to update the errors to |
Tested this change locally and it fixes issue #15 |
@simonprev is it possible to approve this one? The package is totally broken at this moment with the latest Absynthe version. |
Just published 1.1.2 with the changes in this PR 🎉 |
This Merge Request produces problems for me using absinthe Our app handles mutation errors and global errors differently. Before this change, a Middleware could write into the If this is expected behavior, I would expect a breaking change in the versioning. |
Example Middleware in Question: defmodule Acme.Schema.Middleware.CheckAuthenticationRequired do
@moduledoc false
@behaviour Absinthe.Middleware
def call(
%Absinthe.Resolution{context: %{creator_subject: creator_subject}} = resolution,
callback
)
when is_function(callback, 1) and not is_nil(creator_subject) do
resolution
end
def call(resolution, callback) when is_function(callback, 1) do
if callback.(resolution),
do: Absinthe.Resolution.put_result(resolution, {:error, "Unauthenticated"}),
else: resolution
end
end |
This PR indeed broke 10% of our unit tests. We'll stick to v1.1.1 for now. |
After Absinthe 1.4, only update the value is not enough, we also need to update the errors.