Skip to content

Annotate resolvers that require an argument

Alex Kalderimis requested to merge ajk-gql-resolvers-required-argument into master

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

Availability and Testing

Edited by Alex Kalderimis

Merge request reports

Loading