GraphQL: Enable arguments to be marked as deprecated in schema
What does this MR do?
The newer version of the graphql
gem updated in !53697 (merged) supports deprecating arguments within the schema (https://github.com/rmosolgo/graphql-ruby/pull/3015).
Previously, GitLab's deprecated arguments were only marked as such in their description
. This MR additionally marks deprecated arguments as such in the schema (and therefore also in introspection queries).
What has changed?
Resolvers that include the TimeFrameArguments
module receive two deprecated arguments: startDate
and endDate
. This makes the affected parts of the schema the following fields:
Project.milestones
Group.milestones
Project.iterations
Project.milestones
Group.epic
Group.epics
Group.iterations
Group.milestones
BoardEpic.children
Epic.children
Unrelated note: because the deprecated arguments are in a non-deprecated module, over time the module has been included into new resolvers which has had the effect of new fields having instantly deprecated arguments. The arguments in the module are due to be removed in %14.0.
QA testing
There are two ways to see the change in this branch:
- Diffing the output of
bundle exec rake gitlab:graphql:schema:dump
between this branch andmaster
- Comparing GraphiQL on this branch locally http://127.0.0.1:3000/-/graphql-explorer vs production https://gitlab.com/-/graphql-explorer. The "Documentation Explorer" on the right-hand side can be used to compare the above fields.
Using GraphiQL we can QA that queries that use the deprecated arguments are still valid:
{
group(fullPath: "gitlab-org") {
epics(startDate: "2020-12-12", endDate: "2021-01-12") {
nodes {
id
}
}
}
}
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