code: def _filter_fields(self, filter_function):
          
          fields = []
          if self.parent_type:
              fields.extend(self.parent_type._filter_fields(filter_function))
          fields.extend(filter(filter_function, self.fields))
          return fields
docs: Utility to iterate through all fields (super types first) of a type.
  
          :param filter: A function that takes in a Field object. If it returns
              True, the field is part of the generated output. If False, it is
              omitted.