# Buggy code
async def create_source_event_stream(
    self,
    execution_ctx: ExecutionContext,
    request_ctx: Optional[Dict[str, Any]],
    parent_result: Optional[Any] = None,
):
    if not self.subscribe:
        raise GraphQLError(
            "Can't execute a subscription query on a field which doesn't "
            "provide a source event stream with < @Subscription >."
        )

    # TODO: refactor this to have re-usable code with `_ResolverExecutor`
    arguments = self.field_executor.schema_field.get_arguments_default_values()
    arguments.update(
        {argument.name: argument.value for argument in self.arguments.values()}
    )

    return self.subscribe(
        parent_result,
        arguments,
        request_ctx,
        Info(
            query_field=self,
            schema_field=self.field_executor.schema_field,
            schema=self.schema,
            path=self.path,
            location=self.location,
            execution_ctx=execution_ctx,
        ),
    )


# 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
async def create_source_event_stream(
    self,
    execution_ctx: ExecutionContext,
    request_ctx: Optional[Dict[str, Any]],
    parent_result: Optional[Any] = None,
):
    if not self.subscribe:
        raise GraphQLError(
            "Can't execute a subscription query on a field which doesn't "
            "provide a source event stream with < @Subscription >."
        )

    info = Info(
        query_field=self,
        schema_field=self.field_executor.schema_field,
        schema=self.schema,
        path=self.path,
        location=self.location,
        execution_ctx=execution_ctx,
    )

    return self.subscribe(
        parent_result,
        await coerce_arguments(
            self.field_executor.schema_field.arguments,
            self.arguments,
            request_ctx,
            info,
        ),
        request_ctx,
        info,
    )