Skip to content

Commit

Permalink
Merge pull request #16 from jhnnsrs/fix-json-serialization
Browse files Browse the repository at this point in the history
Updated to 0.3 api
  • Loading branch information
jhnnsrs authored Nov 22, 2022
2 parents 7de8a67 + 92bfc19 commit cf60e6a
Show file tree
Hide file tree
Showing 28 changed files with 1,749 additions and 562 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.4]
poetry-version: [1.2]
os: [macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -33,7 +33,7 @@ jobs:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.4]
poetry-version: [1.2]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
poetry-version: [1.1.4]
poetry-version: [1.2]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
17 changes: 12 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@

## Inspiration

Rath is like Apollo, but for python. It adheres to the design principle of Links and enables complex GraphQL
setups, like seperation of query and subscription endpoints, dynamic token loading, etc..
Rath is a transportation agnostic graphql client for python focused on composability. It utilizes Links to
compose GraphQL request logic, similar to the apollo client in typescript. It comes with predefined links to
enable transports like aiohttp, websockets and httpx, as well as links to retrieve auth tokens, enable retry logic
or validating requests on a schema.

## Supported Transports

- aiohttp
- httpx
- websockets

## Installation

Expand Down Expand Up @@ -51,8 +59,7 @@ with Rath(links=compose(auth,link)) as rath:
result = rath.query(query)
```

This example composes both the AuthToken and AioHttp link: During each query the Bearer headers are set to the retrieved token, on authentication fail (for example if Token Expired) the
AuthToken automatically refetches the token and retries the query.
This example composes both the AuthToken and AioHttp link: During each query the Bearer headers are set to the retrieved token, on authentication fail (for example if Token Expired) the AuthToken automatically refetches the token and retries the query.

## Async Usage

Expand Down Expand Up @@ -101,7 +108,7 @@ accomplished by providing a split link.
link = SplitLink(
AioHttpLink(url="https://api.spacex.land/graphql/"),
WebsocketLink(url="ws://api.spacex.land/graphql/",
lamda o: o.node.operation == OperationType.SUBSCRIPTION
lambda o: o.node.operation == OperationType.SUBSCRIPTION
)

rath = Rath(link=link)
Expand Down
Loading

0 comments on commit cf60e6a

Please sign in to comment.