GraphQL: Add fields selection to export requirements mutation
What does this MR do?
Related to #290823 (closed)
As the next iteration for !50546 (merged) we want to allow the mutation to accept a new argument that will be an array of strings indicating which fields should be included in the exported CSV file.
For this to be possible we need to include the new argument in the worker that is called from the mutation: IssuableExportCsvWorker
. Then this worker will call the export service (RequirementsManagement::ExportCsvService
in this case) that will filter the selected fields.
New mutation argument selectedFields
:
- Mutation
mutation {
exportRequirements(input: {projectPath: "group-1/project-1", state: OPENED, sort: CREATED_DESC, search: "test", selectedFields: ["title", "description"]}) {
errors
}
}
Response
{
"data": {
"exportRequirements": {
"errors": []
}
}
}
Response with error
{
"data": {
"exportRequirements": null
},
"errors": [
{
"message": "The following fields are incorrect: IID. See https://docs.gitlab.com/ee/user/project/requirements/#exported-csv-file-format for permitted fields.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"exportRequirements"
]
}
]
}
Screenshots (strongly suggested)
All columns | Selected columns only |
---|---|
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Eugenia Grieff