Reduction
Internally, Hypertune reduces your flag logic given a GraphQL query. You can try it out in the Preview view of the UI.
For example, given the schema:
And logic:
If the reducer is given the GraphQL query:
It will reduce the logic to:
This logic is fully reduced, i.e. in normal form, and so can be evaluated into JSON:
Partial reduction
You don't have to provide all of the field arguments in your GraphQL query. The reducer will reduce your logic as much as possible given the arguments you do provide.
For the schema and logic in the example above, if the reducer is given the GraphQL query:
It will reduce the logic to:
Note that the condition that references context.user.id
has been evaluated and replaced with true
but the condition that references context.user.email
is still there as the query did not provide that argument.
This logic is partially reduced and so cannot be evaluated into JSON. It must be further reduced first.
Partial reduction is useful during SDK initialization.
Last updated