@@ -5,10 +5,6 @@ function inList(list, attribute) {
55 return ~ list . indexOf ( attribute ) ;
66}
77
8- function notType ( type , model , attribute ) {
9- return ! ( model . rawAttributes [ attribute ] . type instanceof type ) ;
10- }
11-
128export default function generateIncludes ( simpleAST , type , root , options ) {
139 var result = { include : [ ] , attributes : [ ] , order : [ ] } ;
1410
@@ -23,8 +19,7 @@ export default function generateIncludes(simpleAST, type, root, options) {
2319 , args = simpleAST . fields [ key ] . args
2420 , includeResolver = type . _fields [ name ] . resolve
2521 , nestedResult
26- , allowedAttributes
27- , Sequelize ;
22+ , allowedAttributes ;
2823
2924 if ( ! includeResolver ) return ;
3025
@@ -80,11 +75,9 @@ export default function generateIncludes(simpleAST, type, root, options) {
8075 delete includeOptions . order ;
8176 }
8277
83- Sequelize = association . target . sequelize . constructor ;
8478 includeOptions . attributes = ( includeOptions . attributes || [ ] )
8579 . concat ( Object . keys ( simpleAST . fields [ key ] . fields ) )
86- . filter ( inList . bind ( null , allowedAttributes ) )
87- . filter ( notType . bind ( null , Sequelize . VIRTUAL , association . target ) ) ;
80+ . filter ( inList . bind ( null , allowedAttributes ) ) ;
8881
8982 includeOptions . attributes . push ( association . target . primaryKeyAttribute ) ;
9083
0 commit comments