diff options
Diffstat (limited to 'app/graphql/types/kas/agent_connection_type.rb')
-rw-r--r-- | app/graphql/types/kas/agent_connection_type.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/app/graphql/types/kas/agent_connection_type.rb b/app/graphql/types/kas/agent_connection_type.rb new file mode 100644 index 00000000000..9c6321bece9 --- /dev/null +++ b/app/graphql/types/kas/agent_connection_type.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +module Types + module Kas + # rubocop: disable Graphql/AuthorizeTypes + class AgentConnectionType < BaseObject + graphql_name 'ConnectedAgent' + description 'Connection details for an Agent' + + field :connected_at, + Types::TimeType, + null: true, + description: 'When the connection was established.' + + field :connection_id, + GraphQL::Types::BigInt, + null: true, + description: 'ID of the connection.' + + field :metadata, + Types::Kas::AgentMetadataType, + method: :agent_meta, + null: true, + description: 'Information about the Agent.' + + def connected_at + Time.at(object.connected_at.seconds) + end + end + # rubocop: enable Graphql/AuthorizeTypes + end +end |