@@ -144,26 +144,25 @@ def get_field(field_name, context = GraphQL::Query::NullContext)
144144 nil
145145 end
146146
147-
148- # @return [Hash<String => GraphQL::Schema::Field>] Fields on this object, keyed by name, including inherited fields
149- def fields ( context = GraphQL :: Query :: NullContext )
150- # Objects need to check that the interface implementation is visible, too
151- warden = Warden . from_context ( context )
152- # Local overrides take precedence over inherited fields
153- visible_fields = { }
154- for ancestor in ancestors
155- if ancestor . respond_to? ( : own_fields) && visible_interface_implementation? ( ancestor , context , warden )
156- ancestor . own_fields . each do | field_name , fields_entry |
157- # Choose the most local definition that passes `.visible?` --
158- # stop checking for fields by name once one has been found.
159- if ! visible_fields . key? ( field_name ) && ( f = Warden . visible_entry? ( :visible_field? , fields_entry , context , warden ) )
160- visible_fields [ field_name ] = f
147+ # @return [Hash<String => GraphQL::Schema::Field>] Fields on this object, keyed by name, including inherited fields
148+ def fields ( context = GraphQL ::Query :: NullContext )
149+ # Objects need to check that the interface implementation is visible, too
150+ warden = Warden . from_context ( context )
151+ # Local overrides take precedence over inherited fields
152+ visible_fields = { }
153+ for ancestor in ancestors
154+ if ancestor . respond_to? ( :own_fields ) && visible_interface_implementation? ( ancestor , context , warden )
155+ ancestor . own_fields . each do | field_name , fields_entry |
156+ # Choose the most local definition that passes `.visible?` --
157+ # stop checking for fields by name once one has been found.
158+ if ! visible_fields . key? ( field_name ) && ( f = Warden . visible_entry? ( :visible_field? , fields_entry , context , warden ) )
159+ visible_fields [ field_name ] = f
160+ end
161161 end
162162 end
163163 end
164+ visible_fields
164165 end
165- visible_fields
166- end
167166 end
168167
169168 def self . included ( child_class )
0 commit comments