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
+23-5
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 differing 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',()=>{
@@ -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 differing 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