Skip to content

Commit

Permalink
Update README.md and CHANGELOG.md to reflect the latest changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
prokher committed May 2, 2023
1 parent d42c840 commit dc10522
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## [1.0.0rc3] - 2023-05-02

- Call synchronous resolvers in the main eventloop.
- Added example of middleware which offloads synchronous resolvers to
- Invoke synchronous resolvers in the main thread with eventloop. So
there is no difference in this aspect with async resolvers. This
corresponds to the behavior of the
[`graphql-core`](https://github.com/graphql-python/graphql-core)
library.
- Added example of middleware which offloads synchronous resolvers to
the threadpool.
- Fixed bug with GraphQL WrappingTypes like GraphQLNonNull causing
exceptions when used as subscription field.
exceptions when used as subscription field.
- Fixed broken example.

## [1.0.0rc2] - 2023-04-28
Expand Down
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,10 @@ asynchronous resolvers in your code. It will work faster.
### Context and scope

The context object (`info.context` in resolvers) is a `SimpleNamespace`
instance useful to transfer extra data between GraphQL resolvers. The lifetime
of `info.context` corresponds to the lifetime of GraphQL request, so it does
not persist content between different queries/mutations/subscriptions. It also
contains some useful extras:
instance useful to transfer extra data between GraphQL resolvers. The
lifetime of `info.context` corresponds to the lifetime of GraphQL
request, so it does not persist content between different
queries/mutations/subscriptions. It also contains some useful extras:
- `graphql_operation_id`: The GraphQL operation id came from the client.
- `graphql_operation_name`: The name of GraphQL operation.
- `channels_scope`: [Channels scope](https://channels.readthedocs.io/en/latest/topics/consumers.html#scope).
Expand Down Expand Up @@ -505,14 +505,12 @@ processing. For that define `middleware` setting of your
```python
async def threadpool_for_sync_resolvers(next_middleware, root, info, *args, **kwds):
"""Offload synchronous resolvers to the threadpool.
This middleware should always be the last in the middlewares calls
stack and the closest to the real resolver. If this middleware is
not the last it will check the next middleware to call instead of
real resolver.
The first middleware in the middlewares list will be the closest to
the resolver.
real resolver. The first middleware in the middlewares list will be
the closest to the resolver.
"""
# Invoke next middleware.
if asyncio.iscoroutinefunction(next_middleware):
Expand Down

0 comments on commit dc10522

Please sign in to comment.