1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Strategies for generating valid GraphQL names and identifiers.
//!
//! GraphQL names follow the pattern `[_A-Za-z][_0-9A-Za-z]*`.
//! See [Names](https://spec.graphql.org/September2025/#Name) in the spec.
//!
//! Written by Claude Code, reviewed by a human.
use *;
use BoxedStrategy;
/// Generates a valid GraphQL name: `[_A-Za-z][_0-9A-Za-z]{0,15}`.
///
/// No reserved-word filtering is applied here. In GraphQL, `true`,
/// `false`, and `null` are only reserved in specific contexts (enum
/// values), not as general names — they are valid as type names,
/// field names, directive names, etc.
/// Generates a valid GraphQL name suitable for use as a fragment name.
///
/// Fragment names must not be `on` (which is reserved for type
/// conditions), per
/// [FragmentName](https://spec.graphql.org/September2025/#FragmentName).
/// Generates a valid GraphQL name suitable for use as an enum value.
///
/// Enum value names must not be `true`, `false`, or `null`, per
/// [EnumValue](https://spec.graphql.org/September2025/#EnumValue).
/// Generates a simple type name (capitalised by convention).
///
/// While GraphQL does not enforce capitalisation, type names are
/// conventionally PascalCase. We generate names starting with an
/// uppercase letter to produce more realistic documents.
/// Generates a simple field/argument name (lowercase by convention).
/// Generates a directive name (lowercase by convention).