Skip to content

Commit d6a87ae

Browse files
Copilotxperiandri
andauthored
docs: simplify ObjectListFilter overview
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
1 parent 8cd78ae commit d6a87ae

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

README.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -405,22 +405,23 @@ type FieldFilter<'Val> =
405405
Value : 'Val }
406406
407407
type ObjectListFilter =
408-
| And of ObjectListFilter * ObjectListFilter
409-
| Or of ObjectListFilter * ObjectListFilter
410-
| Not of ObjectListFilter
411-
| Equals of FieldFilter<System.IComparable> * System.Collections.IComparer
412-
| GreaterThan of FieldFilter<System.IComparable>
413-
| GreaterThanOrEqual of FieldFilter<System.IComparable>
414-
| LessThan of FieldFilter<System.IComparable>
415-
| LessThanOrEqual of FieldFilter<System.IComparable>
416-
| In of FieldFilter<obj list>
417-
| StartsWith of FieldFilter<string> * StringComparer
418-
| EndsWith of FieldFilter<string> * StringComparer
419-
| Contains of FieldFilter<System.IComparable> * System.Collections.IComparer
420-
| OfTypes of Type list
421-
| FilterField of FieldFilter<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 ...
422422
```
423423

424+
- `Equals`, `StartsWith`, `EndsWith`, and `Contains` now carry a comparer in the public DU.
424425
- `Equals` and `Contains` keep the non-generic `System.Collections.IComparer` because they also support non-string comparable values in the public DU.
425426
- 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.
426427
- The built-in case-sensitive operators (`===`, `=@@`, `@@=`, `@=@`) still use the default comparer behavior for you.

src/FSharp.Data.GraphQL.Server.Middleware/SchemaDefinitions.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ let ObjectListFilterType : InputCustomDefinition<ObjectListFilter> = {
184184
(String.concat
185185
" "
186186
[
187-
"The `ObjectListFilter` input represents field filters for object lists."
187+
"The `ObjectListFilter` value represents field filters for object lists."
188188
"Lowercase string suffixes such as `_starts_with`/`_sw`, `_ends_with`/`_ew`, `_contains`, and `_equals`/`_eq` are case-insensitive when applied to string fields."
189189
"Capitalized string suffixes such as `_Starts_With`/`_SW`, `_Ends_With`/`_EW`, `_Contains`, and `_Equals`/`_EQ` are case-sensitive when applied to string fields."
190190
"Comparison suffixes such as `_gt`, `_gte`, `_lt`, `_lte`, and `_in` are also supported."

0 commit comments

Comments
 (0)