Skip to content

Commit 28ad0b6

Browse files
authored
fix: restore support for filtering domain types and internal name types (#86)
* allow filtering on domain types using base type operators * allow filtering `name` types (internal string type used in pg_catalog)
1 parent eb9ca58 commit 28ad0b6

21 files changed

+4022
-119
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ The following types have additional operators:
137137
| SIMILAR TO '...' | similarTo: `String` | Matches the specified pattern using the SQL standard's definition of a regular expression. |
138138
| NOT SIMILAR TO '...' | notSimilarTo: `String` | Does not match the specified pattern using the SQL standard's definition of a regular expression. |
139139

140+
### Domains
141+
142+
Domain fields have the same operators as the domain's base type. For example, a domain type declared with `create domain ... as text check (...);` would have all of the String operators.
143+
140144
### Enums
141145

142146
Enum fields have the same operators as scalar fields.
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
query char4Domain($v2: Char4Domain = "tEST", $v3: Char4Domain = "Test") {
2+
distinctFrom: allDomainTypes(filter: { char4Domain: { distinctFrom: $v2 } }) {
3+
...nodes
4+
}
5+
endsWith: allDomainTypes(filter: { char4Domain: { endsWith: "t" } }) {
6+
...nodes
7+
}
8+
endsWithInsensitive: allDomainTypes(
9+
filter: { char4Domain: { endsWithInsensitive: "t" } }
10+
) {
11+
...nodes
12+
}
13+
equalTo: allDomainTypes(filter: { char4Domain: { equalTo: $v2 } }) {
14+
...nodes
15+
}
16+
greaterThan: allDomainTypes(filter: { char4Domain: { greaterThan: $v2 } }) {
17+
...nodes
18+
}
19+
greaterThanOrEqualTo: allDomainTypes(
20+
filter: { char4Domain: { greaterThanOrEqualTo: $v2 } }
21+
) {
22+
...nodes
23+
}
24+
in: allDomainTypes(filter: { char4Domain: { in: [$v2, $v3] } }) {
25+
...nodes
26+
}
27+
includes: allDomainTypes(filter: { char4Domain: { includes: "t" } }) {
28+
...nodes
29+
}
30+
includesInsensitive: allDomainTypes(
31+
filter: { char4Domain: { includesInsensitive: "t" } }
32+
) {
33+
...nodes
34+
}
35+
isNull: allDomainTypes(filter: { char4Domain: { isNull: true } }) {
36+
...nodes
37+
}
38+
lessThan: allDomainTypes(filter: { char4Domain: { lessThan: $v2 } }) {
39+
...nodes
40+
}
41+
lessThanOrEqualTo: allDomainTypes(
42+
filter: { char4Domain: { lessThanOrEqualTo: $v2 } }
43+
) {
44+
...nodes
45+
}
46+
like: allDomainTypes(filter: { char4Domain: { like: "%es%" } }) {
47+
...nodes
48+
}
49+
likeInsensitive: allDomainTypes(
50+
filter: { char4Domain: { likeInsensitive: "%es%" } }
51+
) {
52+
...nodes
53+
}
54+
notDistinctFrom: allDomainTypes(
55+
filter: { char4Domain: { notDistinctFrom: $v2 } }
56+
) {
57+
...nodes
58+
}
59+
notEndsWith: allDomainTypes(filter: { char4Domain: { notEndsWith: "t" } }) {
60+
...nodes
61+
}
62+
notEndsWithInsensitive: allDomainTypes(
63+
filter: { char4Domain: { notEndsWithInsensitive: "t" } }
64+
) {
65+
...nodes
66+
}
67+
notEqualTo: allDomainTypes(filter: { char4Domain: { notEqualTo: $v2 } }) {
68+
...nodes
69+
}
70+
notIn: allDomainTypes(filter: { char4Domain: { notIn: [$v2] } }) {
71+
...nodes
72+
}
73+
notIncludes: allDomainTypes(filter: { char4Domain: { notIncludes: "t" } }) {
74+
...nodes
75+
}
76+
notIncludesInsensitive: allDomainTypes(
77+
filter: { char4Domain: { notIncludesInsensitive: "t" } }
78+
) {
79+
...nodes
80+
}
81+
notLike: allDomainTypes(filter: { char4Domain: { notLike: "%es%" } }) {
82+
...nodes
83+
}
84+
notLikeInsensitive: allDomainTypes(
85+
filter: { char4Domain: { notLikeInsensitive: "%es%" } }
86+
) {
87+
...nodes
88+
}
89+
notSimilarTo: allDomainTypes(
90+
filter: { char4Domain: { notSimilarTo: "%(te|st)%" } }
91+
) {
92+
...nodes
93+
}
94+
notStartsWith: allDomainTypes(
95+
filter: { char4Domain: { notStartsWith: "t" } }
96+
) {
97+
...nodes
98+
}
99+
notStartsWithInsensitive: allDomainTypes(
100+
filter: { char4Domain: { notStartsWithInsensitive: "t" } }
101+
) {
102+
...nodes
103+
}
104+
similarTo: allDomainTypes(
105+
filter: { char4Domain: { similarTo: "%(te|st)%" } }
106+
) {
107+
...nodes
108+
}
109+
startsWith: allDomainTypes(filter: { char4Domain: { startsWith: "t" } }) {
110+
...nodes
111+
}
112+
startsWithInsensitive: allDomainTypes(
113+
filter: { char4Domain: { startsWithInsensitive: "t" } }
114+
) {
115+
...nodes
116+
}
117+
}
118+
119+
fragment nodes on DomainTypesConnection {
120+
nodes {
121+
id
122+
}
123+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
query dateDomain($v2: DateDomain = "1999-02-01", $v3: DateDomain = "1999-03-01") {
2+
distinctFrom: allDomainTypes(filter: { dateDomain: { distinctFrom: $v2 } }) {
3+
...nodes
4+
}
5+
equalTo: allDomainTypes(filter: { dateDomain: { equalTo: $v2 } }) {
6+
...nodes
7+
}
8+
greaterThan: allDomainTypes(filter: { dateDomain: { greaterThan: $v2 } }) {
9+
...nodes
10+
}
11+
greaterThanOrEqualTo: allDomainTypes(
12+
filter: { dateDomain: { greaterThanOrEqualTo: $v2 } }
13+
) {
14+
...nodes
15+
}
16+
in: allDomainTypes(filter: { dateDomain: { in: [$v2, $v3] } }) {
17+
...nodes
18+
}
19+
isNull: allDomainTypes(filter: { dateDomain: { isNull: true } }) {
20+
...nodes
21+
}
22+
lessThan: allDomainTypes(filter: { dateDomain: { lessThan: $v2 } }) {
23+
...nodes
24+
}
25+
lessThanOrEqualTo: allDomainTypes(
26+
filter: { dateDomain: { lessThanOrEqualTo: $v2 } }
27+
) {
28+
...nodes
29+
}
30+
notDistinctFrom: allDomainTypes(
31+
filter: { dateDomain: { notDistinctFrom: $v2 } }
32+
) {
33+
...nodes
34+
}
35+
notEqualTo: allDomainTypes(filter: { dateDomain: { notEqualTo: $v2 } }) {
36+
...nodes
37+
}
38+
notIn: allDomainTypes(filter: { dateDomain: { notIn: [$v2] } }) {
39+
...nodes
40+
}
41+
}
42+
43+
fragment nodes on DomainTypesConnection {
44+
nodes {
45+
id
46+
}
47+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
query int4Domain($v2: Int4Domain = 2, $v3: Int4Domain = 3) {
2+
distinctFrom: allDomainTypes(filter: { int4Domain: { distinctFrom: $v2 } }) {
3+
...nodes
4+
}
5+
equalTo: allDomainTypes(filter: { int4Domain: { equalTo: $v2 } }) {
6+
...nodes
7+
}
8+
greaterThan: allDomainTypes(filter: { int4Domain: { greaterThan: $v2 } }) {
9+
...nodes
10+
}
11+
greaterThanOrEqualTo: allDomainTypes(
12+
filter: { int4Domain: { greaterThanOrEqualTo: $v2 } }
13+
) {
14+
...nodes
15+
}
16+
in: allDomainTypes(filter: { int4Domain: { in: [$v2, $v3] } }) {
17+
...nodes
18+
}
19+
isNull: allDomainTypes(filter: { int4Domain: { isNull: true } }) {
20+
...nodes
21+
}
22+
lessThan: allDomainTypes(filter: { int4Domain: { lessThan: $v2 } }) {
23+
...nodes
24+
}
25+
lessThanOrEqualTo: allDomainTypes(
26+
filter: { int4Domain: { lessThanOrEqualTo: $v2 } }
27+
) {
28+
...nodes
29+
}
30+
notDistinctFrom: allDomainTypes(
31+
filter: { int4Domain: { notDistinctFrom: $v2 } }
32+
) {
33+
...nodes
34+
}
35+
notEqualTo: allDomainTypes(filter: { int4Domain: { notEqualTo: $v2 } }) {
36+
...nodes
37+
}
38+
notIn: allDomainTypes(filter: { int4Domain: { notIn: [$v2] } }) {
39+
...nodes
40+
}
41+
}
42+
43+
fragment nodes on DomainTypesConnection {
44+
nodes {
45+
id
46+
}
47+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
query name($v2: String = "tEST", $v3: String = "Test") {
2+
distinctFrom: allFilterables(filter: { name: { distinctFrom: $v2 } }) {
3+
...nodes
4+
}
5+
endsWith: allFilterables(filter: { name: { endsWith: "t" } }) {
6+
...nodes
7+
}
8+
endsWithInsensitive: allFilterables(
9+
filter: { name: { endsWithInsensitive: "t" } }
10+
) {
11+
...nodes
12+
}
13+
equalTo: allFilterables(filter: { name: { equalTo: $v2 } }) {
14+
...nodes
15+
}
16+
greaterThan: allFilterables(filter: { name: { greaterThan: $v2 } }) {
17+
...nodes
18+
}
19+
greaterThanOrEqualTo: allFilterables(
20+
filter: { name: { greaterThanOrEqualTo: $v2 } }
21+
) {
22+
...nodes
23+
}
24+
in: allFilterables(filter: { name: { in: [$v2, $v3] } }) {
25+
...nodes
26+
}
27+
includes: allFilterables(filter: { name: { includes: "t" } }) {
28+
...nodes
29+
}
30+
includesInsensitive: allFilterables(
31+
filter: { name: { includesInsensitive: "t" } }
32+
) {
33+
...nodes
34+
}
35+
isNull: allFilterables(filter: { name: { isNull: true } }) {
36+
...nodes
37+
}
38+
lessThan: allFilterables(filter: { name: { lessThan: $v2 } }) {
39+
...nodes
40+
}
41+
lessThanOrEqualTo: allFilterables(
42+
filter: { name: { lessThanOrEqualTo: $v2 } }
43+
) {
44+
...nodes
45+
}
46+
like: allFilterables(filter: { name: { like: "%es%" } }) {
47+
...nodes
48+
}
49+
likeInsensitive: allFilterables(
50+
filter: { name: { likeInsensitive: "%es%" } }
51+
) {
52+
...nodes
53+
}
54+
notDistinctFrom: allFilterables(filter: { name: { notDistinctFrom: $v2 } }) {
55+
...nodes
56+
}
57+
notEndsWith: allFilterables(filter: { name: { notEndsWith: "t" } }) {
58+
...nodes
59+
}
60+
notEndsWithInsensitive: allFilterables(
61+
filter: { name: { notEndsWithInsensitive: "t" } }
62+
) {
63+
...nodes
64+
}
65+
notEqualTo: allFilterables(filter: { name: { notEqualTo: $v2 } }) {
66+
...nodes
67+
}
68+
notIn: allFilterables(filter: { name: { notIn: [$v2] } }) {
69+
...nodes
70+
}
71+
notIncludes: allFilterables(filter: { name: { notIncludes: "t" } }) {
72+
...nodes
73+
}
74+
notIncludesInsensitive: allFilterables(
75+
filter: { name: { notIncludesInsensitive: "t" } }
76+
) {
77+
...nodes
78+
}
79+
notLike: allFilterables(filter: { name: { notLike: "%es%" } }) {
80+
...nodes
81+
}
82+
notLikeInsensitive: allFilterables(
83+
filter: { name: { notLikeInsensitive: "%es%" } }
84+
) {
85+
...nodes
86+
}
87+
notSimilarTo: allFilterables(
88+
filter: { name: { notSimilarTo: "%(te|st)%" } }
89+
) {
90+
...nodes
91+
}
92+
notStartsWith: allFilterables(filter: { name: { notStartsWith: "t" } }) {
93+
...nodes
94+
}
95+
notStartsWithInsensitive: allFilterables(
96+
filter: { name: { notStartsWithInsensitive: "t" } }
97+
) {
98+
...nodes
99+
}
100+
similarTo: allFilterables(filter: { name: { similarTo: "%(te|st)%" } }) {
101+
...nodes
102+
}
103+
startsWith: allFilterables(filter: { name: { startsWith: "t" } }) {
104+
...nodes
105+
}
106+
startsWithInsensitive: allFilterables(
107+
filter: { name: { startsWithInsensitive: "t" } }
108+
) {
109+
...nodes
110+
}
111+
}
112+
113+
fragment nodes on FilterablesConnection {
114+
nodes {
115+
id
116+
}
117+
}

0 commit comments

Comments
 (0)