diff --git a/docs/changelog/changes_07.rst b/docs/changelog/changes_07.rst index 942b253..7758328 100644 --- a/docs/changelog/changes_07.rst +++ b/docs/changelog/changes_07.rst @@ -57,12 +57,14 @@ Changes in 0.7 - Added support for enums :ref:`Check enums documentation ` - Added support for custom scalars :ref:`Check custom scalars documentation ` - Added support for extensions :ref:`Check extensions documentation ` + - Added ``QueryParseCache`` extension - cache parsed graphql queries ast. - Added ``QueryTransformCache`` extension - cache transformed graphql ast into query Node. - Added ``QueryValidationCache`` extension - cache query validation. - Added ``QueryDepthValidator`` extension - validate query depth - Added ``PrometheusMetrics`` extension - wrapper around ``GraphMetrics`` visitor - Added ``PrometheusMetricsAsync`` extension - wrapper around ``AsyncGraphMetrics`` visitor + - Add new method ``Engine.execute_context``, which accepts ``ExecutionContext``. ``Engine.execute`` now dispatches to ``Engine.execute_context``. - Add new method ``Engine.execute_mutation``, which allows to execute query against mutation graph - Add optional ``context`` argument to ``GraphqlEndpoint.dispatch`` method diff --git a/docs/extensions.rst b/docs/extensions.rst index 384db17..4f73ddc 100644 --- a/docs/extensions.rst +++ b/docs/extensions.rst @@ -36,10 +36,13 @@ Writing extension .. code-block:: python - from hiku.extensions import Extension + from typing import Iterator + + from hiku.extensions.base_extension import Extension + from hiku.context import ExecutionContext class TimeItExtension(Extension): - def on_execute(self): + def on_execute(self, execution_context: ExecutionContext) -> Iterator[None]: start = time.perf_counter() yield print('Query execution took {:.3f} seconds'.format(time.perf_counter() - start))