fix: always return a list from pkey_fields (#59)

This commit is contained in:
Barnabas Jovanovics 2023-02-24 16:00:00 +01:00 committed by GitHub
parent 99a1bfcb8c
commit e6aadc1221
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -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,