Skip to content

Deterministic (seeded) enum values #5735

@fkling

Description

@fkling

This is a follow up issue for #2272 (where it is suggested to open a new issue).

Is your feature request related to a problem? Please describe.

Some parts of the mock data generation process use their own source of randomness and are difficult to work around. Specifically the generation of enum values.

Describe the solution you'd like

The API could accept a function that returns a random value which is used instead of Math.random(). That would allow the user to make the default behavior deterministic.

Describe alternatives you've considered

Providing custom data generators for every enum type. It's impractical for larger schemas and tedious to account for schema changes.
Generators for enum values could themselves be generated with a custom codgen plugin, but that also requires an understanding of the codegen process.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions