File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ The corresponding between extra dependencies required and the GQL classes is:
5151+---------------------+------------------------------------------------------------------+
5252| requests | :ref: `RequestsHTTPTransport <requests_transport >` |
5353+---------------------+------------------------------------------------------------------+
54- | httpx | :ref: `HTTPTXTransport <httpx_transport >` |
54+ | httpx2 or httpx | :ref: `HTTPTXTransport <httpx_transport >` |
5555| | |
5656| | :ref: `HTTPXAsyncTransport <httpx_async_transport >` |
5757+---------------------+------------------------------------------------------------------+
Original file line number Diff line number Diff line change 33HTTPXTransport
44==============
55
6- The HTTPXTransport is a sync transport using the `httpx `_ library
6+ The HTTPXTransport is a sync transport using the `httpx2 `_ or ` httpx `_ library
77and allows you to send GraphQL queries using the HTTP protocol.
88
99Reference: :class: `gql.transport.httpx.HTTPXTransport `
1010
1111.. literalinclude :: ../code_examples/httpx_sync.py
1212
1313.. _httpx : https://www.python-httpx.org
14+ .. _httpx2 : https://httpx2.pydantic.dev
Original file line number Diff line number Diff line change 33HTTPXAsyncTransport
44===================
55
6- This transport uses the `httpx `_ library and allows you to send GraphQL queries using the HTTP protocol.
6+ This transport uses the `httpx2 `_ or ` httpx `_ library and allows you to send GraphQL queries using the HTTP protocol.
77
88Reference: :class: `gql.transport.httpx.HTTPXAsyncTransport `
99
@@ -37,3 +37,4 @@ You can manually set the cookies which will be sent with each connection:
3737 transport = HTTPXAsyncTransport(url = url, cookies = {" cookie1" : " val1" })
3838
3939 .. _httpx : https://www.python-httpx.org
40+ .. _httpx2 : https://httpx2.pydantic.dev
Original file line number Diff line number Diff line change 1717try :
1818 import httpx2 as httpx
1919except ModuleNotFoundError : # pragma: no cover
20- import httpx
20+ import httpx # type: ignore[no-redef]
2121
2222from graphql import ExecutionResult
2323
Original file line number Diff line number Diff line change 5252 "httpx>=0.27.0,<1" ,
5353]
5454
55+ install_httpx2_requires = [
56+ "httpx2>=2.0.0,<3" ,
57+ ]
58+
5559install_websockets_requires = [
5660 "websockets>=14.2,<16" ,
5761]
6569]
6670
6771install_all_requires = (
68- install_aiohttp_requires + install_requests_requires + install_httpx_requires + install_websockets_requires + install_botocore_requires + install_aiofiles_requires
72+ install_aiohttp_requires + install_requests_requires + install_httpx2_requires + install_websockets_requires + install_botocore_requires + install_aiofiles_requires
6973)
7074
7175# Get version from __version__.py file
110114 "aiohttp" : install_aiohttp_requires ,
111115 "requests" : install_requests_requires ,
112116 "httpx" : install_httpx_requires ,
117+ "httpx2" : install_httpx2_requires ,
113118 "websockets" : install_websockets_requires ,
114119 "botocore" : install_botocore_requires ,
115120 "aiofiles" : install_aiofiles_requires ,
Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ async def test_httpx_extra_args(aiohttp_server):
439439 try :
440440 import httpx2 as httpx
441441 except ModuleNotFoundError : # pragma: no cover
442- import httpx
442+ import httpx # type: ignore[no-redef]
443443
444444 from aiohttp import web
445445
Original file line number Diff line number Diff line change @@ -328,7 +328,7 @@ async def test_httpx_async_batch_extra_args(aiohttp_server):
328328 try :
329329 import httpx2 as httpx
330330 except ModuleNotFoundError : # pragma: no cover
331- import httpx
331+ import httpx # type: ignore[no-redef]
332332
333333 from aiohttp import web
334334
You can’t perform that action at this time.
0 commit comments