# Buggy code
def __init__(
    self,
    name: str,
    gql_type: Union[str, GraphQLType],
    default_value: Optional[Any] = None,
    description: Optional[str] = None,
    schema=None,
) -> None:
    # TODO: Narrow the default_value type ?
    self.name = name
    self.gql_type = gql_type
    self.default_value = default_value
    self.description = description
    self._type = {}
    self._schema = schema


# Traceback (tartiflette.types.exceptions.tartiflette.UnexpectedASTNode)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/src/app/***/__main__.py", line 10, in <module>
sys.exit(run())
File "/usr/src/app/***/app.py", line 425, in run
"utils/sdl-generator/schema.sdl",
File "/usr/src/app/***/engines/tartiflette.py", line 70, in __init__
error_coercer=_error_coercer,
File "/usr/local/lib/python3.7/site-packages/tartiflette/engine.py", line 26, in __init__
schema_name, custom_default_resolver, exclude_builtins_scalars
File "/usr/local/lib/python3.7/site-packages/tartiflette/schema/bakery.py", line 41, in bake
schema = SchemaBakery._preheat(schema_name, exclude_builtins_scalars)
File "/usr/local/lib/python3.7/site-packages/tartiflette/schema/bakery.py", line 21, in _preheat
build_graphql_schema_from_sdl(sdl, schema=schema)
File "/usr/local/lib/python3.7/site-packages/tartiflette/sdl/builder.py", line 30, in build_graphql_schema_from_sdl
sdl, parse_graphql_sdl_to_ast(sdl), schema=schema
File "/usr/local/lib/python3.7/site-packages/tartiflette/sdl/builder.py", line 76, in transform_ast_to_schema
transformer.transform(raw_ast)
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 93, in transform
tree = t.transform(tree)
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 107, in transform
subtree.children = list(self._transform_children(subtree.children))
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 44, in _transform_children
yield self._transform_tree(c) if isinstance(c, Tree) else c
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 103, in _transform_tree
return self._call_userfunc(tree)
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 37, in _call_userfunc
return f(tree)
File "/usr/local/lib/python3.7/site-packages/lark/visitors.py", line 232, in f
return _f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/tartiflette/sdl/transformers/schema_transformer.py", line 389, in input_value_definition
child, child.__class__.__name__
tartiflette.types.exceptions.tartiflette.UnexpectedASTNode: Unexpected AST node `SchemaNode(type='directives', value={'maxLength': {'limit': 512}})`, type `SchemaNode`

# Fixed code
def __init__(
    self,
    name: str,
    gql_type: Union[str, GraphQLType],
    default_value: Optional[Any] = None,
    description: Optional[str] = None,
    directives: Optional[Dict[str, Optional[dict]]] = None,
    schema=None,
) -> None:
    # TODO: Narrow the default_value type ?
    self.name = name
    self.gql_type = gql_type
    self.default_value = default_value
    self.description = description
    self._type = {}
    self._schema = schema
    self._directives = directives

    # Introspection Attribute
    self._directives_implementations = None