Skip to content

Commit 6eea423

Browse files
committed
feat(graphql): update to gql 4.0.0
BREAKING CHANGE: GraphQL.execute() no longer accepts graphql.Source
1 parent 36629a4 commit 6eea423

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ repos:
2525
- id: pylint
2626
additional_dependencies:
2727
- argcomplete==2.0.0
28-
- gql==3.5.0
28+
- gql==4.0.0
2929
- httpx==0.27.2
3030
- pytest==7.4.2
3131
- requests==2.28.1
@@ -37,7 +37,7 @@ repos:
3737
- id: mypy
3838
args: []
3939
additional_dependencies:
40-
- gql==3.5.0
40+
- gql==4.0.0
4141
- httpx==0.27.2
4242
- jinja2==3.1.2
4343
- pytest==7.4.2

gitlab/client.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
try:
1919
import gql
2020
import gql.transport.exceptions
21-
import graphql
2221
import httpx
2322

2423
from ._backends.graphql import GitlabAsyncTransport, GitlabTransport
@@ -1350,7 +1349,7 @@ def __enter__(self) -> GraphQL:
13501349
def __exit__(self, *args: Any) -> None:
13511350
self._http_client.close()
13521351

1353-
def execute(self, request: str | graphql.Source, *args: Any, **kwargs: Any) -> Any:
1352+
def execute(self, request: str, *args: Any, **kwargs: Any) -> Any:
13541353
parsed_document = self._gql(request)
13551354
retry = utils.Retry(
13561355
max_retries=self._max_retries,
@@ -1420,9 +1419,7 @@ async def __aenter__(self) -> AsyncGraphQL:
14201419
async def __aexit__(self, *args: Any) -> None:
14211420
await self._http_client.aclose()
14221421

1423-
async def execute(
1424-
self, request: str | graphql.Source, *args: Any, **kwargs: Any
1425-
) -> Any:
1422+
async def execute(self, request: str, *args: Any, **kwargs: Any) -> Any:
14261423
parsed_document = self._gql(request)
14271424
retry = utils.Retry(
14281425
max_retries=self._max_retries,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dynamic = ["version"]
4343
[project.optional-dependencies]
4444
autocompletion = ["argcomplete>=1.10.0,<3"]
4545
yaml = ["PyYaml>=6.0.1"]
46-
graphql = ["gql[httpx]>=3.5.0,<4"]
46+
graphql = ["gql[httpx]>=3.5.0,<5"]
4747

4848
[project.scripts]
4949
gitlab = "gitlab.cli:main"

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
gql==3.5.3
1+
gql==4.0.0
22
httpx==0.28.1
33
requests==2.32.4
44
requests-toolbelt==1.0.0

0 commit comments

Comments
 (0)