From e6aadc12210a23960fef656629fe07f1caaf9434 Mon Sep 17 00:00:00 2001 From: Barnabas Jovanovics Date: Fri, 24 Feb 2023 16:00:00 +0100 Subject: [PATCH] fix: always return a list from pkey_fields (#59) --- lib/resource/resource.ex | 4 ++-- test/support/resources/post.ex | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/resource/resource.ex b/lib/resource/resource.ex index fd713fa..ea03dae 100644 --- a/lib/resource/resource.ex +++ b/lib/resource/resource.ex @@ -2872,14 +2872,14 @@ defmodule AshGraphql.Resource do attribute = Ash.Resource.Info.attribute(resource, field) field_type = maybe_wrap_non_null(:id, require?) - %Absinthe.Blueprint.Schema.FieldDefinition{ + [%Absinthe.Blueprint.Schema.FieldDefinition{ description: attribute.description, identifier: field, module: schema, name: to_string(attribute.name), type: field_type, __reference__: ref(__ENV__) - } + }] fields -> for field <- fields do diff --git a/test/support/resources/post.ex b/test/support/resources/post.ex index 1237d70..45022fe 100644 --- a/test/support/resources/post.ex +++ b/test/support/resources/post.ex @@ -87,6 +87,7 @@ defmodule AshGraphql.Test.Post do managed_relationship :with_comments, :comments managed_relationship :with_comments_and_tags, :comments, + lookup_with_primary_key?: true, type_name: :create_post_comment_with_tag managed_relationship :with_comments_and_tags, :tags,