Skip to content

Commit

Permalink
Merge pull request #99 from tartiflette/bubu/prepare_1.3.0_release
Browse files Browse the repository at this point in the history
1.3.0 Release
  • Loading branch information
abusi authored Aug 1, 2020
2 parents f02ad94 + b30e754 commit b21e710
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
## [Released]

- [1.x.x]
- [1.3.x]
- [1.3.0](./changelogs/1.3.0.md) - 2020-07-31
- [1.2.x]
- [1.2.0](./changelogs/1.2.0.md) - 2020-01-29
- [1.1.x]
- [1.1.0](./changelogs/1.1.0.md) - 2019-10-02
- [1.0.x]
Expand Down
17 changes: 17 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Maintainers and Contributors
============================

Maintainers
-----------

* [Aurélien BUSI](mailto:[email protected]) - [@abusi](https://github.com/abusi)
* [Klemen SEVER](mailto:[email protected]) - [@achedeuzot](https://github.com/achedeuzot)
* [Stanislas CHOLLET](mailto:[email protected]) - [@tsunammis](https://github.com/tsunammis)
* [Maximilien RAULIC](mailto:[email protected]) - [@Maximilien-R](https://github.com/Maximilien-R)

Contributors
------------

* [@daveoconnor](https://github.com/daveoconnor)
* [@jugdizh](https://github.com/jugdizh)
* [@Ultrabug](https://github.com/ultrabug)
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ web.run_app(
- Can be a path to an SDL
- Can be an array of paths which contain the SDLs
* **engine_schema_name**: Name of the schema used by the built-in engine. Useful for advanced use-cases, see [Schema Registry API](https://tartiflette.io/docs/api/schema-registry).
* **executor_context**: Context which will be passed to each resolver (as a dict). Very useful for passing handlers to services, functions or data that you want to use in your resolvers. The context reference is **unique** per request, a shallow copy is created based on the context passed.
* **executor_context**: Context which will be passed to each resolver (as a dict). Very useful for passing handlers to services, functions or data that you want to use in your resolvers. The context reference is **unique** per request, a shallow copy is created based on the context passed.
- **req**: Request object from `aiohttp`
- **app**: Application object from `aiohttp`
* **executor_http_endpoint**: Endpoint where the GraphQL Engine will be attached, by default on `/graphql`
Expand Down Expand Up @@ -225,4 +225,27 @@ async def resolver_x(parent_result, args, ctx, info):
return result
```

> Note that this feature uses ContextVar and will only works for python 3.7.1 and later.
> Note that this feature uses ContextVar and will only works for python 3.7.1 and later.
OR it is also possible to do, if you do not have ContextVar, or don't want to use them:

```python
from aiohttp import web

def a_callable(req, data, ctx):
return web.json_response(data, headers=ctx["_any_custom_key"])

web.run_app(
register_graphql_handlers(
app=web.Application(),
engine_sdl=_SDL,
response_formatter=a_callable
)
)


@Resolver("Type.field_name")
async def fiel_name_resolver(pr, args, ctx, info):
ctx["_any_custom_key"] = {"X-Header": "What a wonderfull value"}
return something
```
26 changes: 26 additions & 0 deletions changelogs/1.3.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# [1.3.0] - 2020-07-31

## Added

* Added a way to hook the response formatting stage of the request execution. Simply register a callable looking like:

```python
def a_method(req: aiohttp.web.Request, data: Dict[str, Any], ctx: Dict[str, Any]) -> aiohttp.web.Response:
pass
```

This is done via the `register_graphql_handler(..., response_formatter= a_method)`.

## Changed

* [ISSUE-94](https://github.com/tartiflette/tartiflette-aiohttp/issues/94) - Changed the context_factory from a simple async method to an asynccontextmanager decorated one - Thanks [@jugdizh](https://github.com/jugdizh)

* Test platform:
* pytest from 5.3.4 -> 6.0.1
* pytest-asyncio from 0.10.0 -> 0.14.0
* pytest-cov from 2.8.1 -> 2.10.0
* pylint from 2.4.4 -> 2.5.3

## Fixed

* [ISSUE-76](https://github.com/tartiflette/tartiflette-aiohttp/issues/76) - Fix subscrition handling of client disconnection - Thanks [@daveoconnor](https://github.com/daveoconnor)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"async_generator==1.10;python_version=='3.6.*'",
]

_VERSION = "1.2.0"
_VERSION = "1.3.0"

_PACKAGES = find_packages(exclude=["tests*"])

Expand Down

0 comments on commit b21e710

Please sign in to comment.