Commit 89259f26 authored by Max Woolf's avatar Max Woolf

Move ComplianceFramework GraphQL types to correct location

https://gitlab.com/gitlab-org/gitlab/-/merge_requests/34838
added functionality to GraphQL for
reading compliance framework labels but
added relevent classes to the wrong folders.

This MR moves the files to the correct places.
parent ac01a943
# frozen_string_literal: true
# rubocop: disable Graphql/AuthorizeTypes because ComplianceFrameworkType is, and should only be, accessible via ProjectType
module EE
module Types
module ComplianceManagement
class ComplianceFrameworkType < ::Types::BaseObject
graphql_name 'ComplianceFramework'
description 'Represents a ComplianceFramework associated with a Project'
field :name, ComplianceManagement::ProjectSettingEnum,
null: false,
description: 'Name of the compliance framework',
method: :framework
end
end
end
end
# frozen_string_literal: true
module EE
module Types
module ComplianceManagement
class ProjectSettingEnum < ::Types::BaseEnum
description 'Names of compliance frameworks that can be assigned to a Project'
::ComplianceManagement::ComplianceFramework::ProjectSettings.frameworks.keys.each do |k|
value(k)
end
end
end
end
end
......@@ -46,7 +46,7 @@ module EE
description: 'Packages of the project',
resolver: ::Resolvers::PackagesResolver
field :compliance_frameworks, Types::ComplianceManagement::ComplianceFrameworkType.connection_type,
field :compliance_frameworks, ::Types::ComplianceManagement::ComplianceFrameworkType.connection_type,
description: 'Compliance frameworks associated with the project',
resolver: ::Resolvers::ComplianceFrameworksResolver,
null: true
......
......@@ -2,7 +2,7 @@
module Resolvers
class ComplianceFrameworksResolver < BaseResolver
type EE::Types::ComplianceManagement::ComplianceFrameworkType, null: true
type Types::ComplianceManagement::ComplianceFrameworkType, null: true
alias_method :project, :object
......
# frozen_string_literal: true
# rubocop: disable Graphql/AuthorizeTypes because ComplianceFrameworkType is, and should only be, accessible via ProjectType
module Types
module ComplianceManagement
class ComplianceFrameworkType < Types::BaseObject
graphql_name 'ComplianceFramework'
description 'Represents a ComplianceFramework associated with a Project'
field :name, ComplianceManagement::ProjectSettingEnum,
null: false,
description: 'Name of the compliance framework',
method: :framework
end
end
end
# frozen_string_literal: true
module Types
module ComplianceManagement
class ProjectSettingEnum < Types::BaseEnum
description 'Names of compliance frameworks that can be assigned to a Project'
::ComplianceManagement::ComplianceFramework::ProjectSettings.frameworks.keys.each do |k|
value(k)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment