Skip to content

Commit 3bb84ad

Browse files
Add a use case when fields of elements in a union conflict (#96)
Related graphql-hive/gateway#471 --------- Co-authored-by: Kamil Kisiela <[email protected]>
1 parent fd08a6a commit 3bb84ad

File tree

13 files changed

+174
-77
lines changed

13 files changed

+174
-77
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ This repository contains a set of tests to evaluate and compare the compatibilit
1010

1111
| Gateway | Compatibility | Test Cases | Test Suites |
1212
| :-------------------------------------------------------------: | :-----------: | :----------: | :---------: |
13-
| [Hive Gateway](https://the-guild.dev/graphql/hive/docs/gateway) | 100.00% | 🟢 186 | 🟢 41 |
14-
| [Apollo Router](https://www.apollographql.com/) | 97.85% | 🟢 182 ❌ 4 | 🟢 39 ❌ 2 |
15-
| [Apollo Gateway](https://www.apollographql.com/) | 97.31% | 🟢 181 ❌ 5 | 🟢 38 ❌ 3 |
16-
| [Cosmo Router](https://wundergraph.com) | 95.16% | 🟢 177 ❌ 9 | 🟢 36 ❌ 5 |
17-
| [Grafbase Gateway](https://grafbase.com) | 90.86% | 🟢 169 ❌ 17 | 🟢 35 ❌ 6 |
18-
| [Inigo Gateway](https://inigo.io) | 48.92% | 🟢 91 ❌ 95 | 🟢 12 ❌ 29 |
13+
| [Hive Gateway](https://the-guild.dev/graphql/hive/docs/gateway) | 100.00% | 🟢 187 | 🟢 41 |
14+
| [Apollo Router](https://www.apollographql.com/) | 97.86% | 🟢 183 ❌ 4 | 🟢 39 ❌ 2 |
15+
| [Apollo Gateway](https://www.apollographql.com/) | 97.33% | 🟢 182 ❌ 5 | 🟢 38 ❌ 3 |
16+
| [Cosmo Router](https://wundergraph.com) | 95.19% | 🟢 178 ❌ 9 | 🟢 36 ❌ 5 |
17+
| [Grafbase Gateway](https://grafbase.com) | 90.91% | 🟢 170 ❌ 17 | 🟢 35 ❌ 6 |
18+
| [Inigo Gateway](https://inigo.io) | 48.66% | 🟢 91 ❌ 96 | 🟢 12 ❌ 29 |
1919

2020
<!-- gateways:end -->
2121

REPORT.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
| Gateway | Compatibility | Test Cases | Test Suites |
66
| :-------------------------------------------------------------: | :-----------: | :----------: | :---------: |
7-
| [Hive Gateway](https://the-guild.dev/graphql/hive/docs/gateway) | 100.00% | 🟢 186 | 🟢 41 |
8-
| [Apollo Router](https://www.apollographql.com/) | 97.85% | 🟢 182 ❌ 4 | 🟢 39 ❌ 2 |
9-
| [Apollo Gateway](https://www.apollographql.com/) | 97.31% | 🟢 181 ❌ 5 | 🟢 38 ❌ 3 |
10-
| [Cosmo Router](https://wundergraph.com) | 95.16% | 🟢 177 ❌ 9 | 🟢 36 ❌ 5 |
11-
| [Grafbase Gateway](https://grafbase.com) | 90.86% | 🟢 169 ❌ 17 | 🟢 35 ❌ 6 |
12-
| [Inigo Gateway](https://inigo.io) | 48.92% | 🟢 91 ❌ 95 | 🟢 12 ❌ 29 |
7+
| [Hive Gateway](https://the-guild.dev/graphql/hive/docs/gateway) | 100.00% | 🟢 187 | 🟢 41 |
8+
| [Apollo Router](https://www.apollographql.com/) | 97.86% | 🟢 183 ❌ 4 | 🟢 39 ❌ 2 |
9+
| [Apollo Gateway](https://www.apollographql.com/) | 97.33% | 🟢 182 ❌ 5 | 🟢 38 ❌ 3 |
10+
| [Cosmo Router](https://wundergraph.com) | 95.19% | 🟢 178 ❌ 9 | 🟢 36 ❌ 5 |
11+
| [Grafbase Gateway](https://grafbase.com) | 90.91% | 🟢 170 ❌ 17 | 🟢 35 ❌ 6 |
12+
| [Inigo Gateway](https://inigo.io) | 48.66% | 🟢 91 ❌ 96 | 🟢 12 ❌ 29 |
1313

1414
## Detailed Results
1515

@@ -27,7 +27,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
2727
<details>
2828
<summary>Results</summary>
2929
<a href="./src/test-suites/abstract-types">abstract-types</a>
30-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
30+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
3131
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
3232
<pre>🟢🟢🟢🟢</pre>
3333
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>
@@ -120,7 +120,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
120120
<details>
121121
<summary>Results</summary>
122122
<a href="./src/test-suites/abstract-types">abstract-types</a>
123-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
123+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
124124
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
125125
<pre>🟢🟢🟢🟢</pre>
126126
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>
@@ -213,7 +213,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
213213
<details>
214214
<summary>Results</summary>
215215
<a href="./src/test-suites/abstract-types">abstract-types</a>
216-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
216+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
217217
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
218218
<pre>🟢🟢🟢🟢</pre>
219219
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>
@@ -306,7 +306,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
306306
<details>
307307
<summary>Results</summary>
308308
<a href="./src/test-suites/abstract-types">abstract-types</a>
309-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
309+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
310310
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
311311
<pre>❌❌❌🟢</pre>
312312
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>
@@ -399,7 +399,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
399399
<details>
400400
<summary>Results</summary>
401401
<a href="./src/test-suites/abstract-types">abstract-types</a>
402-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
402+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢</pre>
403403
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
404404
<pre>🟢🟢🟢🟢</pre>
405405
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>
@@ -492,7 +492,7 @@ You can look at the full list of tests [here](./src/test-suites/). Every test id
492492
<details>
493493
<summary>Results</summary>
494494
<a href="./src/test-suites/abstract-types">abstract-types</a>
495-
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢❌❌</pre>
495+
<pre>🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢🟢❌❌</pre>
496496
<a href="./src/test-suites/child-type-mismatch">child-type-mismatch</a>
497497
<pre>❌❌❌🟢</pre>
498498
<a href="./src/test-suites/circular-reference-interface">circular-reference-interface</a>

gateways/apollo-gateway/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
.................
2+
..................
33
child-type-mismatch
44
....
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
............
8383

8484
---
85-
Total: 186
86-
Passed: 181
85+
Total: 187
86+
Passed: 182
8787
Failed: 5

gateways/apollo-router/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
.................
2+
..................
33
child-type-mismatch
44
....
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
............
8383

8484
---
85-
Total: 186
86-
Passed: 182
85+
Total: 187
86+
Passed: 183
8787
Failed: 4

gateways/cosmo-router/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
.................
2+
..................
33
child-type-mismatch
44
XXX.
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
............
8383

8484
---
85-
Total: 186
86-
Passed: 177
85+
Total: 187
86+
Passed: 178
8787
Failed: 9

gateways/grafbase-gateway/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
.................
2+
..................
33
child-type-mismatch
44
....
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
........X..X
8383

8484
---
85-
Total: 186
86-
Passed: 169
85+
Total: 187
86+
Passed: 170
8787
Failed: 17

gateways/hive-gateway/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
.................
2+
..................
33
child-type-mismatch
44
....
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
............
8383

8484
---
85-
Total: 186
86-
Passed: 186
85+
Total: 187
86+
Passed: 187
8787
Failed: 0

gateways/inigo-gateway/results.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
abstract-types
2-
...............XX
2+
...............XXX
33
child-type-mismatch
44
XXX.
55
circular-reference-interface
@@ -82,6 +82,6 @@ union-intersection
8282
XXXXXXXXX.XX
8383

8484
---
85-
Total: 186
85+
Total: 187
8686
Passed: 91
87-
Failed: 95
87+
Failed: 96

src/test-suites/abstract-types/agency.subgraph.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@ export default createSubgraph("agency", {
99
type Agency @key(fields: "id") {
1010
id: ID!
1111
companyName: String
12+
email: Email
13+
}
14+
15+
type Email {
16+
address: String
1217
}
1318
1419
type Group @key(fields: "id") {
1520
id: ID!
1621
name: String
22+
email: String
1723
}
1824
1925
extend union PublisherType = Agency | Group
@@ -26,7 +32,7 @@ export default createSubgraph("agency", {
2632
},
2733
Group: {
2834
__resolveReference(key: { id: string }) {
29-
return { id: key.id, name: "Group " + key.id };
35+
return { id: key.id, name: "Group " + key.id, email: "group" + key.id + "@example.com" };
3036
},
3137
},
3238
},

src/test-suites/abstract-types/data.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,5 +113,8 @@ export const agencies = [
113113
{
114114
id: "a1",
115115
companyName: "Agency 1",
116+
email: {
117+
address: '[email protected]'
118+
}
116119
},
117120
] as const;

0 commit comments

Comments
 (0)