Commit 3506a3a3 authored by Sean McGivern's avatar Sean McGivern

Merge branch '215157-graphql-compliance-move-files' into 'master'

Move ComplianceFramework GraphQL types to correct location

Closes #215157

See merge request gitlab-org/gitlab!35725
parents 66085bbb 89259f26
# 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