# Buggy code
def _validate_non_empty_object(self) -> List[str]:
    """
    Validates that object types implement at least one fields.
    :return: a list of errors
    :rtype: List[str]
    """
    errors = []
    for type_name, gql_type in self.type_definitions.items():
        if (
            isinstance(gql_type, GraphQLObjectType)
            and not gql_type.implemented_fields.values()
        ):
            errors.append(f"Type < {type_name} > has no fields.")
    return errors


# Traceback (KeyError)
Traceback (most recent call last):
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/schema/schema.py", line 348, in get_field_by_name
return self.type_definitions[parent_name].find_field(field_name)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/types/object.py", line 125, in find_field
return self.implemented_fields[name]
KeyError: 'world'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/morse/Documents/GitHub/play-tartiflette/src/__main__.py", line 54, in <module>
run()
File "/Users/morse/Documents/GitHub/play-tartiflette/src/__main__.py", line 52, in run
web.run_app(app, port=8090,)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/web.py", line 415, in run_app
reuse_port=reuse_port))
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/web.py", line 287, in _run_app
await runner.setup()
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/web_runner.py", line 203, in setup
self._server = await self._make_server()
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/web_runner.py", line 302, in _make_server
await self._app.startup()
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/web_app.py", line 389, in startup
await self.on_startup.send(self)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/aiohttp/signals.py", line 34, in send
await receiver(*args, **kwargs)  # type: ignore
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette_aiohttp/__init__.py", line 97, in _cook_on_startup
sdl=sdl, schema_name=schema_name, modules=modules
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/engine.py", line 250, in cook
schema_name, custom_default_resolver, custom_default_type_resolver
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/schema/bakery.py", line 65, in bake
schema = SchemaBakery._preheat(schema_name)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/schema/bakery.py", line 39, in _preheat
obj.bake(schema)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/resolver/resolver.py", line 67, in bake
field = schema.get_field_by_name(self.name)
File "/Users/morse/.pyenv/versions/3.7.2/lib/python3.7/site-packages/tartiflette/schema/schema.py", line 351, in get_field_by_name
f"field `{name}` was not found in GraphQL schema."
tartiflette.types.exceptions.tartiflette.UnknownSchemaFieldResolver: field `Query.world` was not found in GraphQL schema.

# Fixed code
def _validate_non_empty_object(self) -> List[str]:
    """
    Validates that object types implement at least one fields.
    :return: a list of errors
    :rtype: List[str]
    """
    errors = []
    for type_name, gql_type in self.type_definitions.items():
        if isinstance(gql_type, GraphQLObjectType) and not [
            field_name
            for field_name in gql_type.implemented_fields
            if not field_name.startswith("__")
        ]:
            errors.append(f"Type < {type_name} > has no fields.")
    return errors