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,