Skip to main content

requiresFeature

Requires the organization's subscription to include a specific feature. Checks the StripeSubscription.features field for the given feature name. Returns an error if the feature is not available on the current plan.

directive @requiresFeature(
feature: String!
ownerIDArg: String!
fromParent: Boolean = false
) on FIELD_DEFINITION

Arguments

requiresFeature.feature ● String! non-null scalar

The feature name to check (e.g., "code_mode", "strategy_forking", "team_management")

requiresFeature.ownerIDArg ● String! non-null scalar

The argument path to extract the owner ID from (supports dot notation, e.g., "input.ownerID"). Used when fromParent is false (default). When fromParent is true, this is the field name on the parent object to extract the owner ID from (e.g., "ownerID").

requiresFeature.fromParent ● Boolean scalar

If true, extract the owner ID from the parent object's field instead of GraphQL arguments. Use this for field-level feature gating on types (e.g., Strategy.code checking code_mode feature).