sgqlc 18__tar.gz → 19__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sgqlc-18 → sgqlc-19}/PKG-INFO +2 -2
- {sgqlc-18 → sgqlc-19}/doc/source/conf.py +2 -2
- {sgqlc-18 → sgqlc-19}/pyproject.toml +2 -2
- {sgqlc-18 → sgqlc-19}/sgqlc/__init__.py +1 -1
- {sgqlc-18 → sgqlc-19}/sgqlc/codegen/operation.py +2 -2
- {sgqlc-18 → sgqlc-19}/tests/test-operation-codegen.py +34 -0
- {sgqlc-18 → sgqlc-19}/AUTHORS +0 -0
- {sgqlc-18 → sgqlc-19}/LICENSE +0 -0
- {sgqlc-18 → sgqlc-19}/README.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/_static/.keepme +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/_static/logo-sgqlc.png +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/favicon-sgqlc.png +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/index.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.codegen.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.endpoint.base.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.endpoint.http.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.endpoint.requests.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.endpoint.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.endpoint.websocket.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.introspection.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.operation.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.types.datetime.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.types.relay.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.types.rst +0 -0
- {sgqlc-18 → sgqlc-19}/doc/source/sgqlc.types.uuid.rst +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/codegen/__init__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/codegen/__main__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/codegen/schema.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/__init__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/base.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/http.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/httpx.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/requests.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/endpoint/websocket.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/introspection/__init__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/introspection/__main__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/operation/__init__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/types/__init__.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/types/datetime.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/types/relay.py +0 -0
- {sgqlc-18 → sgqlc-19}/sgqlc/types/uuid.py +0 -0
- {sgqlc-18 → sgqlc-19}/tests/test-endpoint-http.py +0 -0
- {sgqlc-18 → sgqlc-19}/tests/test-endpoint-httpx.py +0 -0
- {sgqlc-18 → sgqlc-19}/tests/test-endpoint-requests.py +0 -0
- {sgqlc-18 → sgqlc-19}/tests/test-endpoint-websocket.py +0 -0
- {sgqlc-18 → sgqlc-19}/tests/test-introspection.py +0 -0
{sgqlc-18 → sgqlc-19}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sgqlc
|
|
3
|
-
Version:
|
|
3
|
+
Version: 19
|
|
4
4
|
Summary: Simple GraphQL Client
|
|
5
5
|
License: ISCL
|
|
6
6
|
License-File: AUTHORS
|
|
@@ -21,7 +21,7 @@ Provides-Extra: httpx
|
|
|
21
21
|
Provides-Extra: pytest
|
|
22
22
|
Provides-Extra: requests
|
|
23
23
|
Provides-Extra: websocket
|
|
24
|
-
Requires-Dist: graphql-core (>=3.2.6,<3.
|
|
24
|
+
Requires-Dist: graphql-core (>=3.2.6,<3.4)
|
|
25
25
|
Requires-Dist: httpx ; extra == "httpx"
|
|
26
26
|
Requires-Dist: pytest ; extra == "pytest"
|
|
27
27
|
Requires-Dist: requests ; extra == "requests"
|
|
@@ -61,9 +61,9 @@ author = 'ProFUSION Sistemas e Solucoes LTDA'
|
|
|
61
61
|
# built documents.
|
|
62
62
|
#
|
|
63
63
|
# The short X.Y version.
|
|
64
|
-
version = '
|
|
64
|
+
version = '19'
|
|
65
65
|
# The full version, including alpha/beta/rc tags.
|
|
66
|
-
release = '
|
|
66
|
+
release = '19'
|
|
67
67
|
|
|
68
68
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
|
69
69
|
# for a list of supported languages.
|
|
@@ -29,7 +29,7 @@ norecursedirs = [
|
|
|
29
29
|
|
|
30
30
|
[project]
|
|
31
31
|
name = 'sgqlc'
|
|
32
|
-
version = '
|
|
32
|
+
version = '19'
|
|
33
33
|
description = 'Simple GraphQL Client'
|
|
34
34
|
readme = 'README.rst'
|
|
35
35
|
authors = [
|
|
@@ -49,7 +49,7 @@ classifiers=[
|
|
|
49
49
|
]
|
|
50
50
|
requires-python = '>=3.8,<4'
|
|
51
51
|
dependencies = [
|
|
52
|
-
'graphql-core
|
|
52
|
+
'graphql-core>=3.2.6,<3.4'
|
|
53
53
|
]
|
|
54
54
|
|
|
55
55
|
[tool.poetry]
|
|
@@ -687,7 +687,7 @@ def fragment_%(name)s():
|
|
|
687
687
|
if is_value_required(a):
|
|
688
688
|
required.add(a['name'])
|
|
689
689
|
|
|
690
|
-
for name, _ in node.arguments:
|
|
690
|
+
for name, _ in node.arguments or ():
|
|
691
691
|
if name in required:
|
|
692
692
|
required.remove(name)
|
|
693
693
|
|
|
@@ -700,7 +700,7 @@ def fragment_%(name)s():
|
|
|
700
700
|
def leave_field(self, node, *_args):
|
|
701
701
|
self.validate_required_arguments(node)
|
|
702
702
|
|
|
703
|
-
args = node.arguments
|
|
703
|
+
args = node.arguments or ()
|
|
704
704
|
alias = ''
|
|
705
705
|
if node.alias:
|
|
706
706
|
alias = to_python_name(node.alias)
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
from io import StringIO
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
2
4
|
from graphql import Source
|
|
3
5
|
|
|
4
6
|
from sgqlc.codegen.operation import CodeGen, load_schema, ParsedSchemaName
|
|
@@ -230,3 +232,35 @@ def test_operation_gen_nested_interface():
|
|
|
230
232
|
generated_operations = result_buff.getvalue()
|
|
231
233
|
result_buff.close()
|
|
232
234
|
assert expected_generated_query in generated_operations
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
@pytest.mark.parametrize(
|
|
238
|
+
'schema',
|
|
239
|
+
[None, NESTED_INTERFACE_SCHEMA],
|
|
240
|
+
ids=['without-schema', 'with-schema'],
|
|
241
|
+
)
|
|
242
|
+
def test_operation_gen_no_argument_fields(schema):
|
|
243
|
+
query = '''
|
|
244
|
+
query TestQuery {
|
|
245
|
+
foo {
|
|
246
|
+
fooField
|
|
247
|
+
aliasFoo: fooField
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
'''
|
|
251
|
+
result_buff = StringIO()
|
|
252
|
+
schema_name = ParsedSchemaName.parse_schema_name('.schema')
|
|
253
|
+
|
|
254
|
+
with StringIO(query) as op_file:
|
|
255
|
+
gen = CodeGen(
|
|
256
|
+
load_schema(StringIO(schema)) if schema else None,
|
|
257
|
+
schema_name,
|
|
258
|
+
[Source(op_file.read(), 'op-gen.gql')],
|
|
259
|
+
result_buff.write,
|
|
260
|
+
short_names=False,
|
|
261
|
+
)
|
|
262
|
+
gen.write()
|
|
263
|
+
|
|
264
|
+
generated_operations = result_buff.getvalue()
|
|
265
|
+
assert '_op_foo.foo_field()' in generated_operations
|
|
266
|
+
assert "_op_foo.foo_field(__alias__='alias_foo')" in generated_operations
|
{sgqlc-18 → sgqlc-19}/AUTHORS
RENAMED
|
File without changes
|
{sgqlc-18 → sgqlc-19}/LICENSE
RENAMED
|
File without changes
|
{sgqlc-18 → sgqlc-19}/README.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|