From fc1433170e2a1dba8006c81fb0cc52e262de7f77 Mon Sep 17 00:00:00 2001 From: Zach Daniel Date: Tue, 21 Mar 2023 23:20:15 -0400 Subject: [PATCH] improvement: include primary key when managed relationship can update --- lib/resource/resource.ex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/resource/resource.ex b/lib/resource/resource.ex index 8f6a1c4..9edf0e0 100644 --- a/lib/resource/resource.ex +++ b/lib/resource/resource.ex @@ -1721,9 +1721,8 @@ defmodule AshGraphql.Resource do resource = relationship.destination could_lookup? = ManagedRelationshipHelpers.could_lookup?(opts) could_match? = ManagedRelationshipHelpers.could_update?(opts) - needs_pkey? = opts[:on_no_match] == :match - if could_lookup? || (could_match? && needs_pkey?) do + if could_lookup? || could_match? do pkey_fields = if managed_relationship.lookup_with_primary_key? do resource