BE: Extend complianceFrameworks GraphQL API to support ids argument
Why are we doing this work
To support frontend to display previously saved Policies with Compliance Framework selected, we need to extend backend and GraphQL API to allow to fetch complianceFramework
for the group
with given ids
. To do it we need to extend ee/app/graphql/resolvers/compliance_management/framework_resolver.rb
to allow argument ids
.
Relevant links
Non-functional requirements
-
Documentation: GraphQL documentation is updated - [-] Feature flag: no need for a feature flag
-
Performance: verify performance when fetching multiple IDs (consult query with database team) -
Testing:
Implementation plan
-
MR1 - backend - extend ee/app/graphql/resolvers/compliance_management/framework_resolver.rb
with additional argumentids
:
argument :ids, [::Types::GlobalIDType[::ComplianceManagement::Framework]],
description: 'List of Global IDd of a specific compliance frameworks to return.',
required: false
Verification steps
- Create a new group
- For that group create multiple Compliance Frameworks (Settings -> General -> Compliance Frameworks)
- Go to GraphQL Explorer (
/-/graphql-explorer
) - Try to fetch frameworks with provided IDs. Example query:
query getComplianceFramework( $fullPath: ID! $complianceFrameworks: [ComplianceManagementFrameworkID!] ) { namespace(fullPath: $fullPath) { id name complianceFrameworks(ids: $complianceFrameworks) { nodes { id name default description color pipelineConfigurationFullPath projects { nodes { id name } } } } } }
Edited by Martin Čavoj