2020-05-13 15:08:23 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Types
|
|
|
|
module DesignManagement
|
2020-11-27 12:09:14 +00:00
|
|
|
class DesignCollectionType < ::Types::BaseObject
|
2020-05-13 15:08:23 +00:00
|
|
|
graphql_name 'DesignCollection'
|
2020-09-16 06:09:24 +00:00
|
|
|
description 'A collection of designs'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
authorize :read_design
|
|
|
|
|
|
|
|
field :issue, Types::IssueType, null: false,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'Issue associated with the design collection.'
|
2022-02-28 21:14:01 +00:00
|
|
|
field :project, Types::ProjectType, null: false,
|
|
|
|
description: 'Project associated with the design collection.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
field :designs,
|
|
|
|
Types::DesignManagement::DesignType.connection_type,
|
|
|
|
null: false,
|
|
|
|
resolver: Resolvers::DesignManagement::DesignsResolver,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'All designs for the design collection.',
|
2020-05-13 15:08:23 +00:00
|
|
|
complexity: 5
|
|
|
|
|
|
|
|
field :versions,
|
|
|
|
Types::DesignManagement::VersionType.connection_type,
|
|
|
|
resolver: Resolvers::DesignManagement::VersionsResolver,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'All versions related to all designs, ordered newest first.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
field :version,
|
|
|
|
Types::DesignManagement::VersionType,
|
|
|
|
resolver: Resolvers::DesignManagement::VersionsResolver.single,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'A specific version.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
field :design_at_version, ::Types::DesignManagement::DesignAtVersionType,
|
|
|
|
null: true,
|
|
|
|
resolver: ::Resolvers::DesignManagement::DesignAtVersionResolver,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'Find a design as of a version.'
|
2020-05-13 15:08:23 +00:00
|
|
|
|
|
|
|
field :design, ::Types::DesignManagement::DesignType,
|
|
|
|
null: true,
|
|
|
|
resolver: ::Resolvers::DesignManagement::DesignResolver,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'Find a specific design.'
|
2020-09-22 09:09:43 +00:00
|
|
|
|
|
|
|
field :copy_state, ::Types::DesignManagement::DesignCollectionCopyStateEnum,
|
|
|
|
null: true,
|
2021-01-22 21:09:10 +00:00
|
|
|
description: 'Copy state of the design collection.'
|
2020-05-13 15:08:23 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|