2020-06-01 00:08:25 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
# This Interface contains fields that are shared between objects that include either
|
|
|
|
# the `ResolvableNote` or `ResolvableDiscussion` modules.
|
|
|
|
module ResolvableInterface
|
|
|
|
include Types::BaseInterface
|
|
|
|
|
|
|
|
field :resolved_by, Types::UserType,
|
|
|
|
null: true,
|
2021-02-05 15:09:28 +00:00
|
|
|
description: 'User who resolved the object.'
|
2020-06-01 00:08:25 +00:00
|
|
|
|
|
|
|
def resolved_by
|
|
|
|
return unless object.resolved_by_id
|
|
|
|
|
|
|
|
Gitlab::Graphql::Loaders::BatchModelLoader.new(User, object.resolved_by_id).find
|
|
|
|
end
|
|
|
|
|
2021-07-23 12:09:05 +00:00
|
|
|
field :resolved, GraphQL::Types::Boolean, null: false,
|
2022-08-03 06:10:47 +00:00
|
|
|
description: 'Indicates if the object is resolved.',
|
|
|
|
method: :resolved?
|
2021-07-23 12:09:05 +00:00
|
|
|
field :resolvable, GraphQL::Types::Boolean, null: false,
|
2022-08-03 06:10:47 +00:00
|
|
|
description: 'Indicates if the object can be resolved.',
|
|
|
|
method: :resolvable?
|
2020-06-01 00:08:25 +00:00
|
|
|
field :resolved_at, Types::TimeType, null: true,
|
2022-08-03 06:10:47 +00:00
|
|
|
description: 'Timestamp of when the object was resolved.'
|
2020-06-01 00:08:25 +00:00
|
|
|
end
|
|
|
|
end
|