Rename GraphQL field `hasSolutions` to `hasRemediations` on `vulnerabilities`
The GraphQL field hasSolutions
on vulnerabilities
has caused confusion with a customer (internal Slack link - 2023-06-09) because its name is misleading.
Vulnerabilities::Finding
has a field named solutions
, and the value of this field is shown under the Solution section when viewing a vulnerability on the web.
The hasSolutions
field however does not check this field. Instead it checks if the Vulnerabilities::Finding
has any related Vulnerabilities::Remediation
records.
To make this clearer we should rename hasSolutions
to hasRemediations
.
While debugging this it was noted that the field often returns null
rather than false
. We should fix the method to more reliably return a boolean while we are touching this code.
Proposed solution
-
Add a new field hasRemediations
to thevulnerabilities
GraphQL type with exactly the same behaviour ashasSolutions
-
Deprecate hasSolutions
-
Update front end and any other calling code to use the new field -
Make both fields more reliably return false
rather thannull