Annotate resolvers that require an argument
What does this MR do?
This MR introduces a new DSL method for our BaseResolver
classes: .requires_argument!
.
The purpose of this is to aid static analysis of our fields constructed with these resolvers to mark those that need at least one of several optional arguments to be provided as such.
Without this neither we (nor clients) can tell the difference between fields that do not need any arguments, and ones that will raise a runtime exception if none is provided.
Currently this will be useful for our testing code to help construct legal queries by walking the schema without having to exclude such fields manually. In the future we may be able to make use of it to inform clients of fields that they must pass (this is not a standard GraphQL feature, unfortunately).
As a developer facing tooling change, this does not require a changelog entry.
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.