Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
00ebd95
Support case insensitive comparison with ObjectListFilter
Copilot May 23, 2026
efb8ed4
Redesign ObjectListFilter: add IComparer to Equals/StartsWith/EndsWit…
Copilot Jul 8, 2026
f10e0a1
Add type annotations to CI operators; clarify suffix comment
Copilot Jul 8, 2026
2ba0051
Remove method pairs; use only StringComparison overloads for string o…
Copilot Jul 8, 2026
4db2715
Change StartsWith/EndsWith to use StringComparer; open System.Collect…
Copilot Jul 8, 2026
c3eccde
Rename CI test names to use descriptive "case insensitive" phrasing
Copilot Jul 8, 2026
9fa9659
Add paired case-sensitive/case-insensitive tests to ObjectListFilter …
Copilot Jul 8, 2026
9585b19
Extract filter suffix constants to FilterSuffixConstants.fs
Copilot Jul 8, 2026
d9a81b7
docs: clarify ObjectListFilter suffix behavior
Copilot Jul 8, 2026
37d7d02
docs: clarify ObjectListFilter comparer notes
Copilot Jul 8, 2026
9ec7da0
docs: use F# XML doc conventions
Copilot Jul 8, 2026
880f976
docs: simplify ObjectListFilter examples
Copilot Jul 8, 2026
adf6265
docs: clarify comparer types in README
Copilot Jul 8, 2026
4b2845e
docs: add ObjectListFilter migration note
Copilot Jul 8, 2026
67110b1
docs: polish ObjectListFilter notes
Copilot Jul 8, 2026
8cd78ae
docs: clarify ObjectListFilter wording
Copilot Jul 8, 2026
d6a87ae
docs: simplify ObjectListFilter overview
Copilot Jul 8, 2026
daa682f
docs: rewrite ObjectListFilter README section
Copilot Jul 8, 2026
e3b95b9
docs: finalize ObjectListFilter clarifications
Copilot Jul 8, 2026
18240a5
docs: align ObjectListFilter descriptions
Copilot Jul 8, 2026
03c2285
Use CurrentCulture as default string filter fallback
Copilot Jul 8, 2026
8fc6eb5
Trim excess ObjectListFilter README changes
Copilot Jul 8, 2026
d60aa8e
Tighten ObjectListFilter README wording
Copilot Jul 8, 2026
ac616e3
Restore README ObjectListFilter declaration block
Copilot Jul 8, 2026
1f7b012
Add release note for ObjectListFilter change
Copilot Jul 8, 2026
2dbd474
Update filters to use `CurrentCulture` string comparison
xperiandri Jul 9, 2026
7513c34
fixup! Change StartsWith/EndsWith to use StringComparer; open System.…
xperiandri Jul 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Restore README ObjectListFilter declaration block
Co-authored-by: xperiandri <2365592+xperiandri@users.noreply.github.com>
  • Loading branch information
Copilot and xperiandri authored Jul 8, 2026
commit ac616e3f637d4a72765d012aab8d7862b71486bf
31 changes: 23 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -397,14 +397,29 @@ query TestQuery {
}
```

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`.

- The cases `Equals`, `StartsWith`, `EndsWith`, and `Contains` accept a comparer parameter in the public discriminated union.
- `Equals` and `Contains` keep the non-generic `System.Collections.IComparer` because they also support non-string comparable values in the public discriminated union.
- When the filtered field is a string and you construct the DU cases directly, pass a `StringComparer` instance in that comparer slot. `StringComparer` is accepted there because it also implements `System.Collections.IComparer`. Use `StringComparer.Ordinal` for case-sensitive matching and `StringComparer.OrdinalIgnoreCase` for case-insensitive matching.
- The built-in case-sensitive operators (`===`, `=@@`, `@@=`, `@=@`) use the default comparer behavior.
- `Contains` is also used for collection membership checks, so the wrapped value type inside `FieldFilter<_>` stays `System.IComparable` instead of being limited to `string`.
- If you were previously constructing `Equals`, `StartsWith`, `EndsWith`, or `Contains` directly, update those call sites to provide the comparer argument explicitly.
This filter is mapped by the middleware inside an `ObjectListFilter` definition:

```fsharp
type FieldFilter<'Val> =
{ FieldName : string
Value : 'Val }

type ObjectListFilter =
| And of ObjectListFilter * ObjectListFilter
| Or of ObjectListFilter * ObjectListFilter
| Not of ObjectListFilter
| Equals of Filter : FieldFilter<System.IComparable> * Comparer : System.Collections.IComparer
| GreaterThan of FieldFilter<System.IComparable>
| GreaterThanOrEqual of FieldFilter<System.IComparable>
| LessThan of FieldFilter<System.IComparable>
| LessThanOrEqual of FieldFilter<System.IComparable>
| In of FieldFilter<obj list>
| StartsWith of Filter : FieldFilter<string> * Comparer : System.StringComparer
| EndsWith of Filter : FieldFilter<string> * Comparer : System.StringComparer
| Contains of Filter : FieldFilter<System.IComparable> * Comparer : System.Collections.IComparer
| OfTypes of System.Type list
| FilterField of FieldFilter<ObjectListFilter>
```

And the value recovered by the filter in the query is usable in the `ResolveFieldContext` of the resolve function of the field. To easily access it, you can use the extension method `Filter`, which returns an `ObjectListFilter voption` (it does not have a value if the object doesn't implement a list with the middleware generic definition, or if the user didn't provide a filter input).

Expand Down
Loading