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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
use *;
/// The boolean filter — equality and membership, and the one kind with NO type parameter: `bool` is
/// the only type it guards, so there is nothing for a parameter to range over.
///
/// Four of [`ScalarFilter`]'s eight operators are here and four are not, and ONE rule decides which.
/// A GraphQL operand is frequently a VARIABLE, and a query document has no expression language to
/// compute with one — so an operator survives here when its QUESTION is meaningful and its OPERAND
/// may be unknown until execution. A variable rescues an operator whose operand is unknown. It does
/// not rescue an operator whose question is meaningless.
///
/// `ne` is the first case. A client that means "not `$flag`" writes `ne: $flag`, because
/// `eq: !$flag` is not something a query document can write at all. Whether the two coincide for a
/// LITERAL operand is a property of the LOWERING rather than of the two-valued domain, so it is not
/// this type's to decide either way.
///
/// `in_`/`not_in` are the same case, and "over a two-valued domain membership is degenerate" is that
/// case misread from the author's chair. `in: [true, false]` matches every row and `in: [true]` is
/// exactly `eq: true` — for a reader who knows the operand. A generated or generic client emits
/// `{ field: { in: $values } }` over every field type alike and learns what `$values` holds at
/// execution time; withhold the slots and that client, and the code generator behind it, needs a
/// boolean special case. `in: []` is the sharper half: a computed set that came out empty means
/// MATCH NOTHING, which is a set operand like any other and not a shape `eq` or `ne` can be given —
/// so a two-slot filter makes the client detect the empty case and emit something structurally
/// different.
///
/// No ordering, and the variable rescues nothing there. `false < true` is defined in Rust, but
/// `gt: $flag` asks whether one flag exceeds another, which is meaningless however the operand
/// arrives — `gt`/`gte`/`lt`/`lte` stay out, and a schema offering them would be inviting a client to
/// ask it.
///
/// Nullability needs nothing added here. `Option<bool>` resolves to [`Nullable<BooleanFilter>`]
/// through the framework's one `Option` blanket, and the null test lives only in that wrapper — as
/// it does for every other kind.
///
/// [`Nullable<BooleanFilter>`]: Nullable
/// The bound's row: `new()` and the inherent `with_eq`, reached where the kind is a parameter rather
/// than a spelling.