fix: don't require attributes that have a default value

This commit is contained in:
Zach Daniel 2020-11-30 20:00:55 -05:00
parent 24952b2063
commit fc62c6b8f4

View file

@ -324,7 +324,7 @@ defmodule AshGraphql.Resource do
type = field_type(attribute.type, attribute, resource)
field_type =
if attribute.allow_nil? || mutation.type == :update do
if attribute.allow_nil? || attribute.default || mutation.type == :update do
type
else
%Absinthe.Blueprint.TypeReference.NonNull{