File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -450,18 +450,18 @@ function defineInterfaces(
450
450
'an Array.'
451
451
) ;
452
452
453
- const seenInterfaceNames = [ ] ;
453
+ const implementedTypeNames = { } ;
454
454
interfaces . forEach ( iface => {
455
455
invariant (
456
456
iface instanceof GraphQLInterfaceType ,
457
457
`${ type . name } may only implement Interface types, it cannot ` +
458
458
`implement: ${ String ( iface ) } .`
459
459
) ;
460
460
invariant (
461
- seenInterfaceNames . indexOf ( iface . name ) === - 1 ,
461
+ ! implementedTypeNames [ iface . name ] ,
462
462
`${ type . name } may declare it implements ${ iface . name } only once.`
463
463
) ;
464
- seenInterfaceNames . push ( iface . name ) ;
464
+ implementedTypeNames [ iface . name ] = true ;
465
465
if ( typeof iface . resolveType !== 'function' ) {
466
466
invariant (
467
467
typeof type . isTypeOf === 'function' ,
You can’t perform that action at this time.
0 commit comments