Skip to content

Add query to retrieve individual flag

Administrator requested to merge 06-24-Add_query_to_retrieve_individual_flag into main

Created by: michaellzc

As part of the MI automation work, we would like to be able to retrieve individual feature flag. The existing Query.featureFlags doesn't provide any filtering but return all flags at once.

Test plan

sg start

go to admin console and create a new flag named michael-flag with boolean type

then go to API console and run the following query, you should see the flag

query FeatureFlags {
    featureFlag(name: "michael-flag") {
        ...FeatureFlagFields
    }
}

fragment FeatureFlagFields on FeatureFlag {
    __typename
    ... on FeatureFlagBoolean {
        name
        value
        overrides {
            ...OverrideFields
        }
    }
    ... on FeatureFlagRollout {
        name
        rolloutBasisPoints
        overrides {
            ...OverrideFields
        }
    }
}

fragment OverrideFields on FeatureFlagOverride {
    id
    value
}

Merge request reports

Loading