Handle and test different `link_types` in Resolvers::Vulnerabilities::IssueLinksResolver
Currently the vulnerability issue link resolver defaults to a nil
value but then calls to_s.downcase
.
We should test for a GraphQL error if the link_type
isn't one we expect.
We can use a ready?
method in the resolver for that.
Implementation plan
-
backend Add ready?
method toResolvers::Vulnerabilities::IssueLinksResolver
(https://gitlab.com/gitlab-org/gitlab/blob/30b6f732090b2307bb4673e9bac45fbe2a9207e0/ee/app/graphql/resolvers/vulnerabilities/issue_links_resolver.rb#L5) to verify if provided link_type is one of::Vulnerabilities::IssueLink.link_types
, of not respond with error (https://docs.gitlab.com/ee/development/api_graphql_styleguide.html#correct-use-of-resolverready)
Edited by Justin Zeng