mirror of
https://github.com/ash-project/ash_graphql.git
synced 2024-09-20 05:13:33 +12:00
fix: always return a list from pkey_fields (#59)
This commit is contained in:
parent
99a1bfcb8c
commit
e6aadc1221
2 changed files with 3 additions and 2 deletions
|
@ -2872,14 +2872,14 @@ defmodule AshGraphql.Resource do
|
||||||
attribute = Ash.Resource.Info.attribute(resource, field)
|
attribute = Ash.Resource.Info.attribute(resource, field)
|
||||||
field_type = maybe_wrap_non_null(:id, require?)
|
field_type = maybe_wrap_non_null(:id, require?)
|
||||||
|
|
||||||
%Absinthe.Blueprint.Schema.FieldDefinition{
|
[%Absinthe.Blueprint.Schema.FieldDefinition{
|
||||||
description: attribute.description,
|
description: attribute.description,
|
||||||
identifier: field,
|
identifier: field,
|
||||||
module: schema,
|
module: schema,
|
||||||
name: to_string(attribute.name),
|
name: to_string(attribute.name),
|
||||||
type: field_type,
|
type: field_type,
|
||||||
__reference__: ref(__ENV__)
|
__reference__: ref(__ENV__)
|
||||||
}
|
}]
|
||||||
|
|
||||||
fields ->
|
fields ->
|
||||||
for field <- fields do
|
for field <- fields do
|
||||||
|
|
|
@ -87,6 +87,7 @@ defmodule AshGraphql.Test.Post do
|
||||||
managed_relationship :with_comments, :comments
|
managed_relationship :with_comments, :comments
|
||||||
|
|
||||||
managed_relationship :with_comments_and_tags, :comments,
|
managed_relationship :with_comments_and_tags, :comments,
|
||||||
|
lookup_with_primary_key?: true,
|
||||||
type_name: :create_post_comment_with_tag
|
type_name: :create_post_comment_with_tag
|
||||||
|
|
||||||
managed_relationship :with_comments_and_tags, :tags,
|
managed_relationship :with_comments_and_tags, :tags,
|
||||||
|
|
Loading…
Reference in a new issue