-
Notifications
You must be signed in to change notification settings - Fork 74
Support case-insensitive comparison with ObjectListFilter
#582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
00ebd95
Support case insensitive comparison with ObjectListFilter
Copilot efb8ed4
Redesign ObjectListFilter: add IComparer to Equals/StartsWith/EndsWit…
Copilot f10e0a1
Add type annotations to CI operators; clarify suffix comment
Copilot 2ba0051
Remove method pairs; use only StringComparison overloads for string o…
Copilot 4db2715
Change StartsWith/EndsWith to use StringComparer; open System.Collect…
Copilot c3eccde
Rename CI test names to use descriptive "case insensitive" phrasing
Copilot 9fa9659
Add paired case-sensitive/case-insensitive tests to ObjectListFilter …
Copilot 9585b19
Extract filter suffix constants to FilterSuffixConstants.fs
Copilot d9a81b7
docs: clarify ObjectListFilter suffix behavior
Copilot 37d7d02
docs: clarify ObjectListFilter comparer notes
Copilot 9ec7da0
docs: use F# XML doc conventions
Copilot 880f976
docs: simplify ObjectListFilter examples
Copilot adf6265
docs: clarify comparer types in README
Copilot 4b2845e
docs: add ObjectListFilter migration note
Copilot 67110b1
docs: polish ObjectListFilter notes
Copilot 8cd78ae
docs: clarify ObjectListFilter wording
Copilot d6a87ae
docs: simplify ObjectListFilter overview
Copilot daa682f
docs: rewrite ObjectListFilter README section
Copilot e3b95b9
docs: finalize ObjectListFilter clarifications
Copilot 18240a5
docs: align ObjectListFilter descriptions
Copilot 03c2285
Use CurrentCulture as default string filter fallback
Copilot 8fc6eb5
Trim excess ObjectListFilter README changes
Copilot d60aa8e
Tighten ObjectListFilter README wording
Copilot ac616e3
Restore README ObjectListFilter declaration block
Copilot 1f7b012
Add release note for ObjectListFilter change
Copilot 2dbd474
Update filters to use `CurrentCulture` string comparison
xperiandri 7513c34
fixup! Change StartsWith/EndsWith to use StringComparer; open System.…
xperiandri File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/FSharp.Data.GraphQL.Server.Middleware/FilterSuffixConstants.fs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| /// <summary> | ||
| /// String filter suffixes: | ||
| /// lowercase (e.g. _ends_with, _ew) → case-insensitive (OrdinalIgnoreCase) | ||
| /// Capitalized (e.g. _Ends_With, _EW) → case-sensitive (Ordinal) | ||
| /// <para> | ||
| /// The <see cref="CI"/> submodule contains lowercase suffixes that map to case-insensitive string comparisons. | ||
| /// The <see cref="CS"/> submodule contains capitalized/uppercase suffixes that map to case-sensitive string comparisons. | ||
| /// Numeric and comparison operator suffixes are defined at the module level and are case-insensitive by convention. | ||
| /// </para> | ||
| /// </summary> | ||
| [<RequireQualifiedAccess>] | ||
| module FSharp.Data.GraphQL.Server.Middleware.FilterSuffixConstants | ||
|
|
||
| // Numeric/comparison operators | ||
| [<Literal>] | ||
| let GreaterThanOrEqualSuffix = "_greater_than_or_equal" | ||
| [<Literal>] | ||
| let GTESuffix = "_gte" | ||
| [<Literal>] | ||
| let GreaterThanSuffix = "_greater_than" | ||
| [<Literal>] | ||
| let GTSuffix = "_gt" | ||
| [<Literal>] | ||
| let LessThanOrEqualSuffix = "_less_than_or_equal" | ||
| [<Literal>] | ||
| let LTESuffix = "_lte" | ||
| [<Literal>] | ||
| let LessThanSuffix = "_less_than" | ||
| [<Literal>] | ||
| let LTSuffix = "_lt" | ||
| [<Literal>] | ||
| let InSuffix = "_in" | ||
|
|
||
| /// Case-insensitive string operators (lowercase suffixes → OrdinalIgnoreCase) | ||
| module CI = | ||
| // String operators (case-insensitive) | ||
| [<Literal>] | ||
| let EndsWithSuffix = "_ends_with" | ||
| [<Literal>] | ||
| let EWSuffix = "_ew" | ||
| [<Literal>] | ||
| let StartsWithSuffix = "_starts_with" | ||
| [<Literal>] | ||
| let SWSuffix = "_sw" | ||
| [<Literal>] | ||
| let ContainsSuffix = "_contains" | ||
| [<Literal>] | ||
| let EqualsSuffix = "_equals" | ||
| [<Literal>] | ||
| let EQSuffix = "_eq" | ||
|
|
||
| /// Case-sensitive string operators | ||
| module CS = | ||
| [<Literal>] | ||
| let EndsWithSuffix = "_Ends_With" | ||
| [<Literal>] | ||
| let EWSuffix = "_EW" | ||
| [<Literal>] | ||
| let StartsWithSuffix = "_Starts_With" | ||
| [<Literal>] | ||
| let SWSuffix = "_SW" | ||
| [<Literal>] | ||
| let ContainsSuffix = "_Contains" | ||
| [<Literal>] | ||
| let EqualsSuffix = "_Equals" | ||
| [<Literal>] | ||
| let EQSuffix = "_EQ" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.