OSS-first docs

These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.

flag.toggle

Toggle a feature flag status.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.feature-flags
  • Tags: feature-flags, toggle
  • File: packages/libs/feature-flags/src/contracts/index.ts
  • field.key.label
    flag.toggle
    field.version.label
    1.0.0
    field.type.label
    operation (command)
    field.title.label
    flag.toggle
    field.description.label

    Toggle a feature flag status.

  • Type: operation (command)
  • Version: 1.0.0
  • Stability: stable
  • Owners: platform.feature-flags
  • Tags: feature-flags, toggle
  • File: packages/libs/feature-flags/src/contracts/index.ts
  • field.tags.label
    feature-flags,toggle
    field.owners.label
    platform.feature-flags
    field.stability.label
    stable

    Toggle a feature flag status.

    Goal

    Quickly enable or disable a feature.

    Context

    Called when turning a feature on or off.

    Source Definition

    import { defineCommand, defineQuery } from '@lssm-tech/lib.contracts-spec';
    import { defineSchemaModel, ScalarTypeEnum } from '@lssm-tech/lib.schema';
    
    export const ToggleFlagContract = defineCommand({
    	meta: {
    		key: 'flag.toggle',
    		version: '1.0.0',
    		stability: 'stable',
    		owners: ['platform.feature-flags'],
    		tags: ['feature-flags', 'toggle'],
    		description: 'Toggle a feature flag status.',
    		goal: 'Quickly enable or disable a feature.',
    		context: 'Called when turning a feature on or off.',
    	},
    	io: {
    		input: ToggleFlagInput,
    		output: FeatureFlagModel,
    		errors: {
    			FLAG_NOT_FOUND: {
    				description: 'Flag does not exist',
    				http: 404,
    				gqlCode: 'FLAG_NOT_FOUND',
    				when: 'Flag ID is invalid',
    			},
    			INVALID_STATUS: {
    				description: 'Invalid status value',
    				http: 400,
    				gqlCode: 'INVALID_STATUS',
    				when: 'Status must be OFF, ON, or GRADUAL',
    			},
    		},
    	},
    	policy: {
    		auth: 'admin',
    	},
    });