Skip to content

Commit daa682f

Browse files
Copilotxperiandri
andauthored
docs: rewrite ObjectListFilter README section
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
1 parent d6a87ae commit daa682f

1 file changed

Lines changed: 3 additions & 25 deletions

File tree

README.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -397,32 +397,10 @@ query TestQuery {
397397
}
398398
```
399399

400-
This filter is mapped by the middleware inside an `ObjectListFilter` definition:
400+
This filter is mapped by the middleware into the `ObjectListFilter` discriminated union, with cases such as `And`, `Or`, `Not`, `Equals`, `GreaterThan`, `GreaterThanOrEqual`, `LessThan`, `LessThanOrEqual`, `In`, `StartsWith`, `EndsWith`, `Contains`, `OfTypes`, and `FilterField`.
401401

402-
```fsharp
403-
type FieldFilter<'Val> =
404-
{ FieldName : string
405-
Value : 'Val }
406-
407-
type ObjectListFilter =
408-
| And of ...
409-
| Or of ...
410-
| Not of ...
411-
| Equals of ...
412-
| GreaterThan of ...
413-
| GreaterThanOrEqual of ...
414-
| LessThan of ...
415-
| LessThanOrEqual of ...
416-
| In of ...
417-
| StartsWith of ...
418-
| EndsWith of ...
419-
| Contains of ...
420-
| OfTypes of ...
421-
| FilterField of ...
422-
```
423-
424-
- `Equals`, `StartsWith`, `EndsWith`, and `Contains` now carry a comparer in the public DU.
425-
- `Equals` and `Contains` keep the non-generic `System.Collections.IComparer` because they also support non-string comparable values in the public DU.
402+
- `Equals`, `StartsWith`, `EndsWith`, and `Contains` now carry a comparer in the public discriminated union.
403+
- `Equals` and `Contains` keep the non-generic `System.Collections.IComparer` because they also support non-string comparable values in the public discriminated union.
426404
- When the filtered field is a string and you construct the DU cases directly, pass a `StringComparer` instance in that comparer slot: `StringComparer.Ordinal` for case-sensitive matching and `StringComparer.OrdinalIgnoreCase` for case-insensitive matching.
427405
- The built-in case-sensitive operators (`===`, `=@@`, `@@=`, `@=@`) still use the default comparer behavior for you.
428406
- `Contains` is also used for collection membership checks, so the wrapped value type inside `FieldFilter<_>` stays `System.IComparable` instead of being limited to `string`.

0 commit comments

Comments
 (0)