def _filter_fields(self, filter_function):
fields = []<EOL>if self.parent_type:<EOL><INDENT>fields.extend(self.parent_type._filter_fields(filter_function))<EOL><DEDENT>fields.extend(filter(filter_function, self.fields))<EOL>return fields<EOL>
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.