@@ -20,111 +20,40 @@ type private ComparisonOperator =
2020 | LessThanOrEqual of string
2121 | In of string
2222
23- // String filter suffixes:
24- // lowercase (e.g. _ends_with, _ew) → case-insensitive (OrdinalIgnoreCase)
25- // Capitalized (e.g. _Ends_With, _EW) → case-sensitive (Ordinal)
26- [<Literal>]
27- let private endsWithSuffix = " _ends_with"
28-
29- [<Literal>]
30- let private ewSuffix = " _ew"
31-
32- [<Literal>]
33- let private EndsWithCSSuffix = " _Ends_With"
34-
35- [<Literal>]
36- let private EWCSSuffix = " _EW"
37-
38- [<Literal>]
39- let private startsWithSuffix = " _starts_with"
40-
41- [<Literal>]
42- let private swSuffix = " _sw"
43-
44- [<Literal>]
45- let private StartsWithCSSuffix = " _Starts_With"
46-
47- [<Literal>]
48- let private SWCSSuffix = " _SW"
49-
50- [<Literal>]
51- let private containsSuffix = " _contains"
52-
53- [<Literal>]
54- let private ContainsCSSuffix = " _Contains"
55-
56- [<Literal>]
57- let private equalsSuffix = " _equals"
58-
59- [<Literal>]
60- let private eqSuffix = " _eq"
61-
62- [<Literal>]
63- let private EqualsCSSuffix = " _Equals"
64-
65- [<Literal>]
66- let private EQCSSuffix = " _EQ"
67-
68- [<Literal>]
69- let private greaterThanOrEqualSuffix = " _greater_than_or_equal"
70-
71- [<Literal>]
72- let private gteSuffix = " _gte"
73-
74- [<Literal>]
75- let private greaterThanSuffix = " _greater_than"
76-
77- [<Literal>]
78- let private gtSuffix = " _gt"
79-
80- [<Literal>]
81- let private lessThanOrEqualSuffix = " _less_than_or_equal"
82-
83- [<Literal>]
84- let private lteSuffix = " _lte"
85-
86- [<Literal>]
87- let private lessThanSuffix = " _less_than"
88-
89- [<Literal>]
90- let private ltSuffix = " _lt"
91-
92- [<Literal>]
93- let private inSuffix = " _in"
9423
9524let rec private coerceObjectListFilterInput ( variables : Variables ) inputValue : Result < ObjectListFilter voption , IGQLError list > =
9625
9726 let parseFieldCondition ( s : string ) =
9827 let prefix ( suffix : string ) ( s : string ) = s.Substring ( 0 , s.Length - suffix.Length)
9928 // Phase 1: case-sensitive string ops – match original string against capitalized/uppercase suffixes
10029 match s with
101- | s when s.EndsWith EndsWithCSSuffix && s.Length > EndsWithCSSuffix. Length -> EndsWith ( prefix EndsWithCSSuffix s, StringComparer.Ordinal)
102- | s when s.EndsWith EWCSSuffix && s.Length > EWCSSuffix. Length -> EndsWith ( prefix EWCSSuffix s, StringComparer.Ordinal)
103- | s when s.EndsWith StartsWithCSSuffix && s.Length > StartsWithCSSuffix. Length -> StartsWith ( prefix StartsWithCSSuffix s, StringComparer.Ordinal)
104- | s when s.EndsWith SWCSSuffix && s.Length > SWCSSuffix. Length -> StartsWith ( prefix SWCSSuffix s, StringComparer.Ordinal)
105- | s when s.EndsWith ContainsCSSuffix && s.Length > ContainsCSSuffix. Length -> Contains ( prefix ContainsCSSuffix s, StringComparer.Ordinal)
106- | s when s.EndsWith EqualsCSSuffix && s.Length > EqualsCSSuffix. Length -> StringEquals ( prefix EqualsCSSuffix s, StringComparer.Ordinal)
107- | s when s.EndsWith EQCSSuffix && s.Length > EQCSSuffix. Length -> StringEquals ( prefix EQCSSuffix s, StringComparer.Ordinal)
30+ | s when s.EndsWith FilterSuffixConstants.CS.EndsWithSuffix && s.Length > FilterSuffixConstants.CS.EndsWithSuffix. Length -> EndsWith ( prefix FilterSuffixConstants.CS.EndsWithSuffix s, StringComparer.Ordinal)
31+ | s when s.EndsWith FilterSuffixConstants.CS.EWSuffix && s.Length > FilterSuffixConstants.CS.EWSuffix. Length -> EndsWith ( prefix FilterSuffixConstants.CS.EWSuffix s, StringComparer.Ordinal)
32+ | s when s.EndsWith FilterSuffixConstants.CS.StartsWithSuffix && s.Length > FilterSuffixConstants.CS.StartsWithSuffix. Length -> StartsWith ( prefix FilterSuffixConstants.CS.StartsWithSuffix s, StringComparer.Ordinal)
33+ | s when s.EndsWith FilterSuffixConstants.CS.SWSuffix && s.Length > FilterSuffixConstants.CS.SWSuffix. Length -> StartsWith ( prefix FilterSuffixConstants.CS.SWSuffix s, StringComparer.Ordinal)
34+ | s when s.EndsWith FilterSuffixConstants.CS.ContainsSuffix && s.Length > FilterSuffixConstants.CS.ContainsSuffix. Length -> Contains ( prefix FilterSuffixConstants.CS.ContainsSuffix s, StringComparer.Ordinal)
35+ | s when s.EndsWith FilterSuffixConstants.CS.EqualsSuffix && s.Length > FilterSuffixConstants.CS.EqualsSuffix. Length -> StringEquals ( prefix FilterSuffixConstants.CS.EqualsSuffix s, StringComparer.Ordinal)
36+ | s when s.EndsWith FilterSuffixConstants.CS.EQSuffix && s.Length > FilterSuffixConstants.CS.EQSuffix. Length -> StringEquals ( prefix FilterSuffixConstants.CS.EQSuffix s, StringComparer.Ordinal)
10837 | _ ->
10938 // Phase 2: case-insensitive string ops and numeric ops – lower-case before matching
11039 let s = s.ToLowerInvariant ()
11140 match s with
112- | s when s.EndsWith endsWithSuffix && s.Length > endsWithSuffix. Length -> EndsWith ( prefix endsWithSuffix s, StringComparer.OrdinalIgnoreCase)
113- | s when s.EndsWith ewSuffix && s.Length > ewSuffix. Length -> EndsWith ( prefix ewSuffix s, StringComparer.OrdinalIgnoreCase)
114- | s when s.EndsWith startsWithSuffix && s.Length > startsWithSuffix. Length -> StartsWith ( prefix startsWithSuffix s, StringComparer.OrdinalIgnoreCase)
115- | s when s.EndsWith swSuffix && s.Length > swSuffix. Length -> StartsWith ( prefix swSuffix s, StringComparer.OrdinalIgnoreCase)
116- | s when s.EndsWith containsSuffix && s.Length > containsSuffix. Length -> Contains ( prefix containsSuffix s, StringComparer.OrdinalIgnoreCase)
117- | s when s.EndsWith equalsSuffix && s.Length > equalsSuffix. Length -> StringEquals ( prefix equalsSuffix s, StringComparer.OrdinalIgnoreCase)
118- | s when s.EndsWith eqSuffix && s.Length > eqSuffix. Length -> StringEquals ( prefix eqSuffix s, StringComparer.OrdinalIgnoreCase)
119- | s when s.EndsWith greaterThanOrEqualSuffix && s.Length > greaterThanOrEqualSuffix. Length -> GreaterThanOrEqual ( prefix greaterThanOrEqualSuffix s)
120- | s when s.EndsWith gteSuffix && s.Length > gteSuffix. Length -> GreaterThanOrEqual ( prefix gteSuffix s)
121- | s when s.EndsWith greaterThanSuffix && s.Length > greaterThanSuffix. Length -> GreaterThan ( prefix greaterThanSuffix s)
122- | s when s.EndsWith gtSuffix && s.Length > gtSuffix. Length -> GreaterThan ( prefix gtSuffix s)
123- | s when s.EndsWith lessThanOrEqualSuffix && s.Length > lessThanOrEqualSuffix. Length -> LessThanOrEqual ( prefix lessThanOrEqualSuffix s)
124- | s when s.EndsWith lteSuffix && s.Length > lteSuffix. Length -> LessThanOrEqual ( prefix lteSuffix s)
125- | s when s.EndsWith lessThanSuffix && s.Length > lessThanSuffix. Length -> LessThan ( prefix lessThanSuffix s)
126- | s when s.EndsWith ltSuffix && s.Length > ltSuffix. Length -> LessThan ( prefix ltSuffix s)
127- | s when s.EndsWith inSuffix && s.Length > inSuffix. Length -> In ( prefix inSuffix s)
41+ | s when s.EndsWith FilterSuffixConstants.CI.EndsWithSuffix && s.Length > FilterSuffixConstants.CI.EndsWithSuffix. Length -> EndsWith ( prefix FilterSuffixConstants.CI.EndsWithSuffix s, StringComparer.OrdinalIgnoreCase)
42+ | s when s.EndsWith FilterSuffixConstants.CI.EWSuffix && s.Length > FilterSuffixConstants.CI.EWSuffix. Length -> EndsWith ( prefix FilterSuffixConstants.CI.EWSuffix s, StringComparer.OrdinalIgnoreCase)
43+ | s when s.EndsWith FilterSuffixConstants.CI.StartsWithSuffix && s.Length > FilterSuffixConstants.CI.StartsWithSuffix. Length -> StartsWith ( prefix FilterSuffixConstants.CI.StartsWithSuffix s, StringComparer.OrdinalIgnoreCase)
44+ | s when s.EndsWith FilterSuffixConstants.CI.SWSuffix && s.Length > FilterSuffixConstants.CI.SWSuffix. Length -> StartsWith ( prefix FilterSuffixConstants.CI.SWSuffix s, StringComparer.OrdinalIgnoreCase)
45+ | s when s.EndsWith FilterSuffixConstants.CI.ContainsSuffix && s.Length > FilterSuffixConstants.CI.ContainsSuffix. Length -> Contains ( prefix FilterSuffixConstants.CI.ContainsSuffix s, StringComparer.OrdinalIgnoreCase)
46+ | s when s.EndsWith FilterSuffixConstants.CI.EqualsSuffix && s.Length > FilterSuffixConstants.CI.EqualsSuffix. Length -> StringEquals ( prefix FilterSuffixConstants.CI.EqualsSuffix s, StringComparer.OrdinalIgnoreCase)
47+ | s when s.EndsWith FilterSuffixConstants.CI.EQSuffix && s.Length > FilterSuffixConstants.CI.EQSuffix. Length -> StringEquals ( prefix FilterSuffixConstants.CI.EQSuffix s, StringComparer.OrdinalIgnoreCase)
48+ | s when s.EndsWith FilterSuffixConstants.GreaterThanOrEqualSuffix && s.Length > FilterSuffixConstants.GreaterThanOrEqualSuffix. Length -> GreaterThanOrEqual ( prefix FilterSuffixConstants.GreaterThanOrEqualSuffix s)
49+ | s when s.EndsWith FilterSuffixConstants.GTESuffix && s.Length > FilterSuffixConstants.GTESuffix. Length -> GreaterThanOrEqual ( prefix FilterSuffixConstants.GTESuffix s)
50+ | s when s.EndsWith FilterSuffixConstants.GreaterThanSuffix && s.Length > FilterSuffixConstants.GreaterThanSuffix. Length -> GreaterThan ( prefix FilterSuffixConstants.GreaterThanSuffix s)
51+ | s when s.EndsWith FilterSuffixConstants.GTSuffix && s.Length > FilterSuffixConstants.GTSuffix. Length -> GreaterThan ( prefix FilterSuffixConstants.GTSuffix s)
52+ | s when s.EndsWith FilterSuffixConstants.LessThanOrEqualSuffix && s.Length > FilterSuffixConstants.LessThanOrEqualSuffix. Length -> LessThanOrEqual ( prefix FilterSuffixConstants.LessThanOrEqualSuffix s)
53+ | s when s.EndsWith FilterSuffixConstants.LTESuffix && s.Length > FilterSuffixConstants.LTESuffix. Length -> LessThanOrEqual ( prefix FilterSuffixConstants.LTESuffix s)
54+ | s when s.EndsWith FilterSuffixConstants.LessThanSuffix && s.Length > FilterSuffixConstants.LessThanSuffix. Length -> LessThan ( prefix FilterSuffixConstants.LessThanSuffix s)
55+ | s when s.EndsWith FilterSuffixConstants.LTSuffix && s.Length > FilterSuffixConstants.LTSuffix. Length -> LessThan ( prefix FilterSuffixConstants.LTSuffix s)
56+ | s when s.EndsWith FilterSuffixConstants.InSuffix && s.Length > FilterSuffixConstants.InSuffix. Length -> In ( prefix FilterSuffixConstants.InSuffix s)
12857 | s -> Equals s
12958
13059 let (| EquatableValue | NonEquatableValue |) v =
0 commit comments