@@ -86,6 +86,18 @@ describe('Validate: Overlapping fields can be merged', () => {
86
86
` ) ;
87
87
} ) ;
88
88
89
+ it ( 'different skip/include directives accepted' , ( ) => {
90
+ // Note: Differing skip/include directives don't create an ambiguous return
91
+ // value and are acceptable in conditions where differing runtime values
92
+ // may have the same desired effect of including or skipping a field.
93
+ expectPassesRule ( OverlappingFieldsCanBeMerged , `
94
+ fragment differentDirectivesWithDifferentAliases on Dog {
95
+ name @include(if: true)
96
+ name @include(if: false)
97
+ }
98
+ ` ) ;
99
+ } ) ;
100
+
89
101
it ( 'Same aliases with different field targets' , ( ) => {
90
102
expectFailsRule ( OverlappingFieldsCanBeMerged , `
91
103
fragment sameAliasesWithDifferentFieldTargets on Dog {
@@ -191,66 +203,6 @@ describe('Validate: Overlapping fields can be merged', () => {
191
203
` ) ;
192
204
} ) ;
193
205
194
- it ( 'conflicting directives' , ( ) => {
195
- expectFailsRule ( OverlappingFieldsCanBeMerged , `
196
- fragment conflictingDirectiveArgs on Dog {
197
- name @include(if: true)
198
- name @skip(if: false)
199
- }
200
- ` , [
201
- { message : fieldsConflictMessage (
202
- 'name' ,
203
- 'they have differing directives'
204
- ) ,
205
- locations : [ { line : 3 , column : 9 } , { line : 4 , column : 9 } ] }
206
- ] ) ;
207
- } ) ;
208
-
209
- it ( 'conflicting directive args' , ( ) => {
210
- expectFailsRule ( OverlappingFieldsCanBeMerged , `
211
- fragment conflictingDirectiveArgs on Dog {
212
- name @include(if: true)
213
- name @include(if: false)
214
- }
215
- ` , [
216
- { message : fieldsConflictMessage (
217
- 'name' ,
218
- 'they have differing directives'
219
- ) ,
220
- locations : [ { line : 3 , column : 9 } , { line : 4 , column : 9 } ] }
221
- ] ) ;
222
- } ) ;
223
-
224
- it ( 'conflicting args with matching directives' , ( ) => {
225
- expectFailsRule ( OverlappingFieldsCanBeMerged , `
226
- fragment conflictingArgsWithMatchingDirectiveArgs on Dog {
227
- doesKnowCommand(dogCommand: SIT) @include(if: true)
228
- doesKnowCommand(dogCommand: HEEL) @include(if: true)
229
- }
230
- ` , [
231
- { message : fieldsConflictMessage (
232
- 'doesKnowCommand' ,
233
- 'they have differing arguments'
234
- ) ,
235
- locations : [ { line : 3 , column : 9 } , { line : 4 , column : 9 } ] }
236
- ] ) ;
237
- } ) ;
238
-
239
- it ( 'conflicting directives with matching args' , ( ) => {
240
- expectFailsRule ( OverlappingFieldsCanBeMerged , `
241
- fragment conflictingDirectiveArgsWithMatchingArgs on Dog {
242
- doesKnowCommand(dogCommand: SIT) @include(if: true)
243
- doesKnowCommand(dogCommand: SIT) @skip(if: false)
244
- }
245
- ` , [
246
- { message : fieldsConflictMessage (
247
- 'doesKnowCommand' ,
248
- 'they have differing directives'
249
- ) ,
250
- locations : [ { line : 3 , column : 9 } , { line : 4 , column : 9 } ] }
251
- ] ) ;
252
- } ) ;
253
-
254
206
it ( 'encounters conflict in fragments' , ( ) => {
255
207
expectFailsRule ( OverlappingFieldsCanBeMerged , `
256
208
{
0 commit comments