@@ -74,7 +74,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_SameAliasesWithDifferentFieldTarg
74
74
fido: nickname
75
75
}
76
76
` , []gqlerrors.FormattedError {
77
- testutil .RuleError (`Fields "fido" conflict because name and nickname are different fields.` , 3 , 9 , 4 , 9 ),
77
+ testutil .RuleError (`Fields "fido" conflict because name and nickname are different fields. ` +
78
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
79
+ 3 , 9 , 4 , 9 ),
78
80
})
79
81
}
80
82
func TestValidate_OverlappingFieldsCanBeMerged_SameAliasesAllowedOnNonOverlappingFields (t * testing.T ) {
@@ -96,7 +98,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_AliasMaskingDirectFieldAccess(t *
96
98
name
97
99
}
98
100
` , []gqlerrors.FormattedError {
99
- testutil .RuleError (`Fields "name" conflict because nickname and name are different fields.` , 3 , 9 , 4 , 9 ),
101
+ testutil .RuleError (`Fields "name" conflict because nickname and name are different fields. ` +
102
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
103
+ 3 , 9 , 4 , 9 ),
100
104
})
101
105
}
102
106
func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondAddsAnArgument (t * testing.T ) {
@@ -106,7 +110,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondAddsAnArgumen
106
110
doesKnowCommand(dogCommand: HEEL)
107
111
}
108
112
` , []gqlerrors.FormattedError {
109
- testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments.` , 3 , 9 , 4 , 9 ),
113
+ testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments. ` +
114
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
115
+ 3 , 9 , 4 , 9 ),
110
116
})
111
117
}
112
118
func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondMissingAnArgument (t * testing.T ) {
@@ -116,7 +122,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_DifferentArgs_SecondMissingAnArgu
116
122
doesKnowCommand
117
123
}
118
124
` , []gqlerrors.FormattedError {
119
- testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments.` , 3 , 9 , 4 , 9 ),
125
+ testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments. ` +
126
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
127
+ 3 , 9 , 4 , 9 ),
120
128
})
121
129
}
122
130
func TestValidate_OverlappingFieldsCanBeMerged_ConflictingArgs (t * testing.T ) {
@@ -126,7 +134,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_ConflictingArgs(t *testing.T) {
126
134
doesKnowCommand(dogCommand: HEEL)
127
135
}
128
136
` , []gqlerrors.FormattedError {
129
- testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments.` , 3 , 9 , 4 , 9 ),
137
+ testutil .RuleError (`Fields "doesKnowCommand" conflict because they have differing arguments. ` +
138
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
139
+ 3 , 9 , 4 , 9 ),
130
140
})
131
141
}
132
142
func TestValidate_OverlappingFieldsCanBeMerged_AllowDifferentArgsWhereNoConflictIsPossible (t * testing.T ) {
@@ -156,7 +166,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_EncountersConflictInFragments(t *
156
166
x: b
157
167
}
158
168
` , []gqlerrors.FormattedError {
159
- testutil .RuleError (`Fields "x" conflict because a and b are different fields.` , 7 , 9 , 10 , 9 ),
169
+ testutil .RuleError (`Fields "x" conflict because a and b are different fields. ` +
170
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
171
+ 7 , 9 , 10 , 9 ),
160
172
})
161
173
}
162
174
func TestValidate_OverlappingFieldsCanBeMerged_ReportsEachConflictOnce (t * testing.T ) {
@@ -183,9 +195,15 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReportsEachConflictOnce(t *testin
183
195
x: b
184
196
}
185
197
` , []gqlerrors.FormattedError {
186
- testutil .RuleError (`Fields "x" conflict because a and b are different fields.` , 18 , 9 , 21 , 9 ),
187
- testutil .RuleError (`Fields "x" conflict because a and c are different fields.` , 18 , 9 , 14 , 11 ),
188
- testutil .RuleError (`Fields "x" conflict because b and c are different fields.` , 21 , 9 , 14 , 11 ),
198
+ testutil .RuleError (`Fields "x" conflict because a and b are different fields. ` +
199
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
200
+ 18 , 9 , 21 , 9 ),
201
+ testutil .RuleError (`Fields "x" conflict because a and c are different fields. ` +
202
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
203
+ 18 , 9 , 14 , 11 ),
204
+ testutil .RuleError (`Fields "x" conflict because b and c are different fields. ` +
205
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
206
+ 21 , 9 , 14 , 11 ),
189
207
})
190
208
}
191
209
func TestValidate_OverlappingFieldsCanBeMerged_DeepConflict (t * testing.T ) {
@@ -199,7 +217,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_DeepConflict(t *testing.T) {
199
217
}
200
218
}
201
219
` , []gqlerrors.FormattedError {
202
- testutil .RuleError (`Fields "field" conflict because subfields "x" conflict because a and b are different fields.` ,
220
+ testutil .RuleError (`Fields "field" conflict because subfields "x" conflict because a and b are different fields. ` +
221
+ `Use different aliases on the fields to fetch both if this was intentional.` ,
203
222
3 , 9 ,
204
223
4 , 11 ,
205
224
6 , 9 ,
@@ -219,9 +238,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_DeepConflictWithMultipleIssues(t
219
238
}
220
239
}
221
240
` , []gqlerrors.FormattedError {
222
- testutil .RuleError (
223
- `Fields "field" conflict because subfields "x " conflict because a and b are different fields and ` +
224
- `subfields "y" conflict because c and d are different fields .` ,
241
+ testutil .RuleError (`Fields "field" conflict because subfields "x" conflict because a and b are different fields and ` +
242
+ `subfields "y " conflict because c and d are different fields. ` +
243
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
225
244
3 , 9 ,
226
245
4 , 11 ,
227
246
5 , 11 ,
@@ -245,9 +264,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_VeryDeepConflict(t *testing.T) {
245
264
}
246
265
}
247
266
` , []gqlerrors.FormattedError {
248
- testutil .RuleError (
249
- `Fields "field" conflict because subfields "deepField" conflict because subfields "x" conflict because ` +
250
- `a and b are different fields.` ,
267
+ testutil .RuleError (`Fields "field" conflict because subfields "deepField" conflict because subfields "x" conflict because ` +
268
+ `a and b are different fields. ` +
269
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
251
270
3 , 9 ,
252
271
4 , 11 ,
253
272
5 , 13 ,
@@ -274,9 +293,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReportsDeepConflictToNearestCommo
274
293
}
275
294
}
276
295
` , []gqlerrors.FormattedError {
277
- testutil .RuleError (
278
- `Fields "deepField" conflict because subfields "x" conflict because ` +
279
- `a and b are different fields.` ,
296
+ testutil .RuleError (`Fields "deepField" conflict because subfields "x" conflict because ` +
297
+ `a and b are different fields. ` +
298
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
280
299
4 , 11 ,
281
300
5 , 13 ,
282
301
7 , 11 ,
@@ -486,8 +505,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Conf
486
505
}
487
506
}
488
507
` , []gqlerrors.FormattedError {
489
- testutil .RuleError (
490
- `Fields "scalar" conflict because they return conflicting types Int and String! .` ,
508
+ testutil .RuleError (`Fields "scalar" conflict because they return conflicting types Int and String!. ` +
509
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
491
510
5 , 15 ,
492
511
8 , 15 ),
493
512
})
@@ -526,8 +545,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
526
545
}
527
546
}
528
547
` , []gqlerrors.FormattedError {
529
- testutil .RuleError (
530
- `Fields "scalar" conflict because they return conflicting types Int and String .` ,
548
+ testutil .RuleError (`Fields "scalar" conflict because they return conflicting types Int and String. ` +
549
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
531
550
5 , 15 ,
532
551
8 , 15 ),
533
552
})
@@ -545,8 +564,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
545
564
}
546
565
}
547
566
` , []gqlerrors.FormattedError {
548
- testutil .RuleError (
549
- `Fields "scalar" conflict because they return conflicting types String! and String .` ,
567
+ testutil .RuleError (`Fields "scalar" conflict because they return conflicting types String! and String. ` +
568
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
550
569
5 , 15 ,
551
570
8 , 15 ),
552
571
})
@@ -568,8 +587,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
568
587
}
569
588
}
570
589
` , []gqlerrors.FormattedError {
571
- testutil .RuleError (
572
- `Fields "box" conflict because they return conflicting types [StringBox] and StringBox .` ,
590
+ testutil .RuleError (`Fields "box" conflict because they return conflicting types [StringBox] and StringBox. ` +
591
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
573
592
5 , 15 ,
574
593
10 , 15 ),
575
594
})
@@ -590,8 +609,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
590
609
}
591
610
}
592
611
` , []gqlerrors.FormattedError {
593
- testutil .RuleError (
594
- `Fields "box" conflict because they return conflicting types StringBox and [StringBox] .` ,
612
+ testutil .RuleError (`Fields "box" conflict because they return conflicting types StringBox and [StringBox]. ` +
613
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
595
614
5 , 15 ,
596
615
10 , 15 ),
597
616
})
@@ -614,8 +633,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
614
633
}
615
634
}
616
635
` , []gqlerrors.FormattedError {
617
- testutil .RuleError (
618
- `Fields "val" conflict because scalar and unrelatedField are different fields .` ,
636
+ testutil .RuleError (`Fields "val" conflict because scalar and unrelatedField are different fields. ` +
637
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
619
638
6 , 17 ,
620
639
7 , 17 ),
621
640
})
@@ -637,8 +656,8 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Disa
637
656
}
638
657
}
639
658
` , []gqlerrors.FormattedError {
640
- testutil .RuleError (
641
- `Fields "box" conflict because subfields "scalar" conflict because they return conflicting types String and Int .` ,
659
+ testutil .RuleError (`Fields "box" conflict because subfields "scalar" conflict because they return conflicting types String and Int. ` +
660
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
642
661
5 , 15 ,
643
662
6 , 17 ,
644
663
10 , 15 ,
@@ -704,9 +723,9 @@ func TestValidate_OverlappingFieldsCanBeMerged_ReturnTypesMustBeUnambiguous_Comp
704
723
}
705
724
}
706
725
` , []gqlerrors.FormattedError {
707
- testutil .RuleError (
708
- `Fields "edges" conflict because subfields "node" conflict because subfields "id" conflict because ` +
709
- `id and name are different fields.` ,
726
+ testutil .RuleError (`Fields "edges" conflict because subfields "node" conflict because subfields "id" conflict because ` +
727
+ `id and name are different fields. ` +
728
+ `Use different aliases on the fields to fetch both if this was intentional .` ,
710
729
14 , 11 ,
711
730
15 , 13 ,
712
731
16 , 15 ,
0 commit comments