From fc62c6b8f4045a3c93e74b95b8be536139cbc4a6 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Mon, 30 Nov 2020 20:00:55 -0500 Subject: [PATCH] fix: don't require attributes that have a default value --- 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 6e122a8..85eb0ec 100644 --- a/lib/resource/resource.ex +++ b/lib/resource/resource.ex @@ -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{