What are Experiments?


目录

WPGraphQL Experiments enable the core team to ship, iterate, and gather feedback on potential features without long-term compatibility commitments. This allows the community to "experience the future of WPGraphQL today" while maintaining a stable production API.

Overview

Experiments are optional, experimental features built into WPGraphQL core that you can enable or disable through the WordPress admin. They allow the WPGraphQL team to:

Experiments vs. Extensions vs. Feature Flags

Understanding the difference helps you choose the right tool for your needs:

Aspect Experiments Extensions (Plugins) Feature Flags
Location Built into WPGraphQL core Separate plugins External configuration
Activation WordPress admin settings Plugin activation Code or environment variables
Breaking Changes Allowed during experimental phase Not recommended Not applicable
Lifespan Temporary (2-3 releases) Indefinite Project-specific
Maintenance WPGraphQL core team Extension authors Application developers
Purpose Testing future core features Custom functionality Deployment control

When to use each:

Why Experiments Matter

For Users

For the WPGraphQL Team

Experiment Lifecycle

Every experiment follows a predictable lifecycle:

Proposed → Active → Feedback → Decision
                                    ↓
                    Graduate | Iterate | Deprecate
                        ↓         ↓          ↓
                    Stable   Active    Removed
  1. Proposed: Feature idea is discussed and approved for experimentation
  2. Active Experiment: Feature is available to enable but may change
  3. Feedback Period: Community tests and provides feedback (2-3 releases)
  4. Decision Point:
    • Graduate: Becomes a stable core feature (no more breaking changes)
    • Iterate: Continue experimenting with improvements
    • Deprecate: Marked for removal, users get migration guidance
  5. Final State: Either stable in core or removed

Expected Timeline

Current Experiments

To see which experiments are currently available:

  1. Navigate to GraphQL > Settings > Experiments in your WordPress admin
  2. Review the Experiments README on GitHub
  3. Check release notes for the Experimental badge

Example Experiments (For Developers)

WPGraphQL includes several example experiments that are commented out by default in the codebase. These serve as practical, working examples for developers learning to create experiments:

These examples are located in src/Experimental/Experiment/ and can be enabled by:

  1. Uncommenting the imports and registrations in src/Experimental/ExperimentRegistry.php
  2. Or registering them via the graphql_experiments_registered_classes filter

See Creating Experiments for more details on using these examples as inspiration for your own experiments.

Getting Started

Ready to try experiments?

Experiment Documentation

Each experiment includes comprehensive documentation in its own README.md file:

When you activate an experiment, a link to its documentation is automatically included in the admin notice, providing immediate access to detailed information about how to use it.

Principles

The Experiments API follows these core principles:

  1. Opt-in by default: Experiments never affect users who don't explicitly enable them
  2. Clear communication: Every experiment clearly states its purpose and status
  3. Time-bounded: Experiments must reach a decision; they cannot remain experimental indefinitely
  4. Reversible: Users can always disable experiments and return to stable behavior
  5. Isolated: Experiments should be independent and not break core functionality when disabled

FAQ

Are experiments safe to use?

Experiments are safe to enable but come with caveats:

Recommendation: Test experiments in staging before enabling in production.

Will my site break if an experiment is removed?

No. When an experiment is removed or deprecated, you'll receive:

Can I keep using an experiment indefinitely?

No. Experiments are temporary by design. They will either:

This prevents accumulation of experimental code and keeps WPGraphQL maintainable.

How do I provide feedback on an experiment?

We love feedback! You can:

  1. GitHub Issues: Share detailed thoughts and use cases
  2. GitHub Issues: Report bugs or unexpected behavior
  3. Slack: Quick questions in the WPGraphQL Slack community
  4. Twitter/X: Tag @wpgraphql with your experience

The more specific your feedback, the more valuable it is!

Can plugins create experiments?

The current Experiments API is designed for WPGraphQL core features only. Plugin authors should:

Support

Need help with experiments?

Next Steps


版本号 #2
由 壳壳虫 创建于 2026-08-29 23:36:26 UTC
由 壳壳虫 更新于 2026-08-29 23:36:26 UTC