Skip to content

Commit 7e5be93

Browse files
authored
Merge pull request #25 from qlient-org/develop
Add unittests and fix mutation type issue
2 parents e64f284 + a3caf7f commit 7e5be93

15 files changed

+6064
-67
lines changed

poetry.lock

Lines changed: 134 additions & 50 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "qlient"
3-
version = "0.1.1-alpha"
3+
version = "0.1.2-alpha"
44
description = "A fast and modern graphql client designed with simplicity in mind."
55
authors = ["Daniel Seifert <[email protected]>"]
66
maintainers = ["Daniel Seifert <[email protected]>"]
@@ -39,6 +39,7 @@ platformdirs = "^2.4.1"
3939
coverage = "^6.2"
4040
pytest = "^6.2.5"
4141
requests-mock = "^1.9.3"
42+
strawberry-graphql = "^0.95.1"
4243
hypothesis = "^6.36.0"
4344
yappi = "^1.3.3"
4445
mkdocs = "^1.2.3"

site/sitemap.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,62 +2,62 @@
22
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
33
<url>
44
<loc>https://qlient-org.github.io/python-qlient/</loc>
5-
<lastmod>2022-01-25</lastmod>
5+
<lastmod>2022-01-26</lastmod>
66
<changefreq>daily</changefreq>
77
</url>
88
<url>
99
<loc>https://qlient-org.github.io/python-qlient/install/</loc>
10-
<lastmod>2022-01-25</lastmod>
10+
<lastmod>2022-01-26</lastmod>
1111
<changefreq>daily</changefreq>
1212
</url>
1313
<url>
1414
<loc>https://qlient-org.github.io/python-qlient/examples/project_batches/</loc>
15-
<lastmod>2022-01-25</lastmod>
15+
<lastmod>2022-01-26</lastmod>
1616
<changefreq>daily</changefreq>
1717
</url>
1818
<url>
1919
<loc>https://qlient-org.github.io/python-qlient/examples/script_legend/</loc>
20-
<lastmod>2022-01-25</lastmod>
20+
<lastmod>2022-01-26</lastmod>
2121
<changefreq>daily</changefreq>
2222
</url>
2323
<url>
2424
<loc>https://qlient-org.github.io/python-qlient/usage/backend/</loc>
25-
<lastmod>2022-01-25</lastmod>
25+
<lastmod>2022-01-26</lastmod>
2626
<changefreq>daily</changefreq>
2727
</url>
2828
<url>
2929
<loc>https://qlient-org.github.io/python-qlient/usage/cache/</loc>
30-
<lastmod>2022-01-25</lastmod>
30+
<lastmod>2022-01-26</lastmod>
3131
<changefreq>daily</changefreq>
3232
</url>
3333
<url>
3434
<loc>https://qlient-org.github.io/python-qlient/usage/client/</loc>
35-
<lastmod>2022-01-25</lastmod>
35+
<lastmod>2022-01-26</lastmod>
3636
<changefreq>daily</changefreq>
3737
</url>
3838
<url>
3939
<loc>https://qlient-org.github.io/python-qlient/usage/fields/</loc>
40-
<lastmod>2022-01-25</lastmod>
40+
<lastmod>2022-01-26</lastmod>
4141
<changefreq>daily</changefreq>
4242
</url>
4343
<url>
4444
<loc>https://qlient-org.github.io/python-qlient/usage/proxy/</loc>
45-
<lastmod>2022-01-25</lastmod>
45+
<lastmod>2022-01-26</lastmod>
4646
<changefreq>daily</changefreq>
4747
</url>
4848
<url>
4949
<loc>https://qlient-org.github.io/python-qlient/usage/schema/</loc>
50-
<lastmod>2022-01-25</lastmod>
50+
<lastmod>2022-01-26</lastmod>
5151
<changefreq>daily</changefreq>
5252
</url>
5353
<url>
5454
<loc>https://qlient-org.github.io/python-qlient/usage/schema_providers/</loc>
55-
<lastmod>2022-01-25</lastmod>
55+
<lastmod>2022-01-26</lastmod>
5656
<changefreq>daily</changefreq>
5757
</url>
5858
<url>
5959
<loc>https://qlient-org.github.io/python-qlient/usage/settings/</loc>
60-
<lastmod>2022-01-25</lastmod>
60+
<lastmod>2022-01-26</lastmod>
6161
<changefreq>daily</changefreq>
6262
</url>
6363
</urlset>

site/sitemap.xml.gz

0 Bytes
Binary file not shown.

src/qlient/proxy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ def __init__(self, client):
122122
self.client: Client = client
123123
self.operations: Dict[str, Operation] = self.get_bindings()
124124

125+
def __contains__(self, key: str) -> bool:
126+
return key in self.operations
127+
125128
def __getattr__(self, key: str) -> Operation:
126129
""" Return the OperationProxy for the given key.
127130
@@ -208,7 +211,7 @@ class MutationService(OperationProxy):
208211
def get_bindings(self) -> Dict[str, Operation]:
209212
""" Method to get the mutation service bindings """
210213
bindings = {}
211-
if not self.client.schema.query_type:
214+
if not self.client.schema.mutation_type:
212215
return bindings
213216

214217
for field in self.client.schema.mutation_type.fields:

0 commit comments

Comments
 (0)