From c222e8088af41d4f61f9953bf4c10fb6d8cb5b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Bergstr=C3=B6m?= Date: Wed, 12 May 2021 12:48:58 +0200 Subject: [PATCH] fix: Check for nil rather than the value as `not` does not accept a function (#23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Simon Bergström --- lib/resource/resource.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/resource/resource.ex b/lib/resource/resource.ex index 67577e7..278a35d 100644 --- a/lib/resource/resource.ex +++ b/lib/resource/resource.ex @@ -634,7 +634,7 @@ defmodule AshGraphql.Resource do |> Enum.filter(& &1.writable?) |> Enum.map(fn attribute -> allow_nil? = - attribute.allow_nil? || attribute.default || type == :update || attribute.generated? || + attribute.allow_nil? || attribute.default != nil || type == :update || attribute.generated? || (type == :create && attribute.name in action.allow_nil_input) explicitly_required = attribute.name in action.require_attributes