2020-05-13 15:08:23 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
module DesignManagement
|
|
|
|
class DesignAtVersionType < BaseObject
|
|
|
|
graphql_name 'DesignAtVersion'
|
|
|
|
|
|
|
|
description 'A design pinned to a specific version. ' \
|
2020-09-16 06:09:24 +00:00
|
|
|
'The image field reflects the design as of the associated version'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
authorize :read_design
|
|
|
|
|
|
|
|
delegate :design, :version, to: :object
|
|
|
|
delegate :issue, :filename, :full_path, :diff_refs, to: :design
|
|
|
|
|
|
|
|
implements ::Types::DesignManagement::DesignFields
|
|
|
|
|
|
|
|
field :version,
|
|
|
|
Types::DesignManagement::VersionType,
|
|
|
|
null: false,
|
2021-08-25 15:11:14 +00:00
|
|
|
description: 'Version this design-at-versions is pinned to.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
field :design,
|
|
|
|
Types::DesignManagement::DesignType,
|
|
|
|
null: false,
|
2021-08-25 15:11:14 +00:00
|
|
|
description: 'Underlying design.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
def cached_stateful_version(_parent)
|
|
|
|
version
|
|
|
|
end
|
|
|
|
|
|
|
|
def notes_count
|
|
|
|
design.user_notes_count
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|