Schema
Your project's schema defines your:
Feature flags, i.e. their names and types
Input types for targeting logic, e.g.
User
,Organization
,Environment
You can write your schema in GraphQL. For example, the following schema defines:
A
Boolean
feature flag calledshowNewEditor
Input types called
User
,Organization
andEnvironment
to use in flag targeting logicA
Void
flag to log thePurchase
event
Complex input types
You can define arbitrarily complex types for your inputs. For example, the User
input type can have a field with a list of roles:
Complex flag types
In addition to simple Boolean
feature flags, you can have flags with String
, Int
and Float
types, and custom enum
, object and list types. For example, you can define the following flags on the Root
type:
Flag-specific targeting attributes
Instead of adding new input types and targeting attributes to the top-level Context
, you can add them directly to specific flags.
This is useful if a targeting attribute is only relevant to a specific flag, as it avoids polluting the top-level scope with it, and ensures it can't be accidentally used in the targeting logic of other flags.
It also lets you pass different attribute values to a flag in the same browser session. So you can have flags that depend on the session state like user input, selected options, the current view, etc.
For example, you can define a priceId
flag that depends on the entered promoCode
:
Last updated