Skip to content

Commit

Permalink
Fixes #36160 - add display_name field to Host GraphQL type
Browse files Browse the repository at this point in the history
  • Loading branch information
nofaralfasi authored and stejskalleos committed Jan 11, 2024
1 parent f000358 commit c109691
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/graphql/types/host.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Host < BaseObject
global_id_field :id
timestamps
field :name, String
field :display_name, String, method: :to_label
field :build, Boolean
field :managed, Boolean
field :ip, String
Expand Down
2 changes: 2 additions & 0 deletions test/graphql/queries/host_query_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class HostQueryTest < GraphQLQueryTestCase
createdAt
updatedAt
name
displayName
build
managed
ip
Expand Down Expand Up @@ -116,6 +117,7 @@ class HostQueryTest < GraphQLQueryTestCase
assert_equal host.created_at.utc.iso8601, data['createdAt']
assert_equal host.updated_at.utc.iso8601, data['updatedAt']
assert_equal host.name, data['name']
assert_equal host.to_label, data['displayName']
assert_equal host.build, data['build']
assert_equal host.managed, data['managed']
assert_equal host.ip, data['ip']
Expand Down

0 comments on commit c109691

Please sign in to comment.