You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/validation/__tests__/OverlappingFieldsCanBeMergedRule-test.ts
+29-11
Original file line number
Diff line number
Diff line change
@@ -98,13 +98,22 @@ describe('Validate: Overlapping fields can be merged', () => {
98
98
`);
99
99
});
100
100
101
-
it('Same stream directives supported',()=>{
102
-
expectValid(`
101
+
it('stream directive used on different instances of the same field',()=>{
102
+
expectErrors(`
103
103
fragment differentDirectivesWithDifferentAliases on Dog {
104
104
name @stream(label: "streamLabel", initialCount: 1)
105
105
name @stream(label: "streamLabel", initialCount: 1)
106
106
}
107
-
`);
107
+
`).toDeepEqual([
108
+
{
109
+
message:
110
+
'Fields "name" conflict because they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100. Use different aliases on the fields to fetch both if this was intentional.',
111
+
locations: [
112
+
{line: 3,column: 9},
113
+
{line: 4,column: 9},
114
+
],
115
+
},
116
+
]);
108
117
});
109
118
110
119
it('different stream directive label',()=>{
@@ -116,7 +125,7 @@ describe('Validate: Overlapping fields can be merged', () => {
116
125
`).toDeepEqual([
117
126
{
118
127
message:
119
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
128
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
120
129
locations: [
121
130
{line: 3,column: 9},
122
131
{line: 4,column: 9},
@@ -134,7 +143,7 @@ describe('Validate: Overlapping fields can be merged', () => {
134
143
`).toDeepEqual([
135
144
{
136
145
message:
137
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
146
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
138
147
locations: [
139
148
{line: 3,column: 9},
140
149
{line: 4,column: 9},
@@ -152,7 +161,7 @@ describe('Validate: Overlapping fields can be merged', () => {
152
161
`).toDeepEqual([
153
162
{
154
163
message:
155
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
164
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
156
165
locations: [
157
166
{line: 3,column: 9},
158
167
{line: 4,column: 9},
@@ -170,7 +179,7 @@ describe('Validate: Overlapping fields can be merged', () => {
170
179
`).toDeepEqual([
171
180
{
172
181
message:
173
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
182
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
174
183
locations: [
175
184
{line: 3,column: 9},
176
185
{line: 4,column: 9},
@@ -188,7 +197,7 @@ describe('Validate: Overlapping fields can be merged', () => {
188
197
`).toDeepEqual([
189
198
{
190
199
message:
191
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
200
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
192
201
locations: [
193
202
{line: 3,column: 9},
194
203
{line: 4,column: 9},
@@ -206,7 +215,7 @@ describe('Validate: Overlapping fields can be merged', () => {
206
215
`).toDeepEqual([
207
216
{
208
217
message:
209
-
'Fields "name" conflict because they have differing stream directives. Use different aliases on the fields to fetch both if this was intentional.',
218
+
'Fields "name" conflict because they have overlapping stream directives. Use different aliases on the fields to fetch both if this was intentional.',
210
219
locations: [
211
220
{line: 3,column: 9},
212
221
{line: 4,column: 9},
@@ -216,12 +225,21 @@ describe('Validate: Overlapping fields can be merged', () => {
216
225
});
217
226
218
227
it('different stream directive both missing args',()=>{
219
-
expectValid(`
228
+
expectErrors(`
220
229
fragment conflictingArgs on Dog {
221
230
name @stream
222
231
name @stream
223
232
}
224
-
`);
233
+
`).toDeepEqual([
234
+
{
235
+
message:
236
+
'Fields "name" conflict because they have overlapping stream directives. See https://github.com/graphql/defer-stream-wg/discussions/100. Use different aliases on the fields to fetch both if this was intentional.',
237
+
locations: [
238
+
{line: 3,column: 9},
239
+
{line: 4,column: 9},
240
+
],
241
+
},
242
+
]);
225
243
});
226
244
227
245
it('Same aliases with different field targets',()=>{
0 commit comments