fix: Check for nil rather than the value as not does not accept a function (#23)

Co-authored-by: Simon Bergström <simon.bergstrom@erlang-solutions.com>
This commit is contained in:
Simon Bergström 2021-05-12 12:48:58 +02:00 committed by GitHub
parent e8e3624ce5
commit c222e8088a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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