Add ability hide GraphQL fields via feature flag
What does this MR do?
This adds the functionality of easily hiding a GraphQL field behind a feature flag.
This can be done like so:
field :id, GraphQL::STRING_TYPE,
null: false,
description: 'ID of the item',
feature_flag: :test_feature
When the feature_flag
option is given, we:
- Append the description to indicate it's behind a feature flag.
- Check if the Feature flag is enabled, by overriding the
visible?
method. If it is not enabled, we return aField 'xxx' doesn't exist on type 'xxx'
error.
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
Related to #197129 (closed)
Edited by Sean Arnold