From 4cab09003afa430c1cfb4354649fbfaabcfcb97c Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 00:14:35 -0800 Subject: [PATCH 01/35] Fix error message --- gql/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gql/cli.py b/gql/cli.py index fe6e839..622ca25 100644 --- a/gql/cli.py +++ b/gql/cli.py @@ -39,7 +39,7 @@ def cli(): @click.option('-c', '--config', 'config_filename', default=DEFAULT_CONFIG_FNAME, type=click.Path(exists=True)) def init(schema, root, config_filename): if isfile(config_filename): - click.confirm('gql.yml already exists. Are you sure you want to continue?', abort=True) + click.confirm(f'{config_filename} already exists. Are you sure you want to continue?', abort=True) documents = join_paths(root, '**/*.graphql') config = Config( From 34536d25153e7289971a6692623caaf766442d17 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 12:58:02 -0800 Subject: [PATCH 02/35] Initial codec implementation --- gql/codec/__init__.py | 0 gql/codec/register.py | 158 ++++++++++++++++++++++++++++++++++ gql/codec/transform.py | 46 ++++++++++ gql/renderer_dataclasses.py | 15 +++- tests/_codec/__init__.py | 0 tests/_codec/test_register.py | 33 +++++++ 6 files changed, 249 insertions(+), 3 deletions(-) create mode 100644 gql/codec/__init__.py create mode 100644 gql/codec/register.py create mode 100644 gql/codec/transform.py create mode 100644 tests/_codec/__init__.py create mode 100644 tests/_codec/test_register.py diff --git a/gql/codec/__init__.py b/gql/codec/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/gql/codec/register.py b/gql/codec/register.py new file mode 100644 index 0000000..5f57b7f --- /dev/null +++ b/gql/codec/register.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python +import codecs, encodings +import sys +from encodings import utf_8 +from io import BytesIO +from tokenize import TokenInfo, NAME, OP + +from gql.codec.transform import tokenize_python_stream, untokenize +from gql.config import Config +from gql.query_parser import QueryParser +from gql.renderer_dataclasses import DataclassesRenderer +from gql.utils_schema import load_schema + + +def get_config(): + if 'CONFIG' not in globals(): + globals()['CONFIG'] = Config.load('.gql.json') + + return globals()['CONFIG'] + + +def get_schema(): + if 'SCHEMA' not in globals(): + config = get_config() + globals()['SCHEMA'] = load_schema(config.schema) + + return globals()['SCHEMA'] + + +def get_parser() -> QueryParser: + if 'PARSER' not in globals(): + schema = get_schema() + globals()['PARSER'] = QueryParser(schema) + + return globals()['PARSER'] + + +def get_renderer() -> DataclassesRenderer: + if 'RENDERER' not in globals(): + schema = get_schema() + config = get_config() + globals()['RENDERER'] = DataclassesRenderer(schema, config, classname_prefix='__') + + return globals()['RENDERER'] + + +def gql_transform(stream: BytesIO): + tokens = list(tokenize_python_stream(stream)) + transformed_tokens = [] + + query_started = False + for token in tokens: + if token.type == 1 and token.string == 'gql': # type NAME + query_started = True + continue + + if token.type == 3 and query_started: # type STRING + query_str = token.string.strip("'''") + parsed_query = get_parser().parse(query_str) + rendered = get_renderer().render(parsed_query) + + # verify 2 previous tokens are NAME and OP ('=') + prev_tokens = transformed_tokens[:-2] + gql_tokens = transformed_tokens[-2:] + + if gql_tokens[0].type == NAME and gql_tokens[1].type == OP: + transformed_tokens = prev_tokens + + rendered_token = TokenInfo('CUSTOM', rendered, gql_tokens[0].start, gql_tokens[0].end, gql_tokens[0].line) + transformed_tokens.append(rendered_token) + transformed_tokens.append(gql_tokens[0]) + transformed_tokens.append(gql_tokens[1]) + + op_name = get_renderer().get_operation_class_name(parsed_query) + + transformed_tokens.append(TokenInfo(NAME, op_name, token.start, token.end, token.line)) + continue + + transformed_tokens.append(token) + query_started = False + + result = untokenize(transformed_tokens) + return result.rstrip() + + +def gql_transform_string(input: str): + stream = BytesIO(input.encode('utf-8')) + return gql_transform(stream) + + +def gql_decode(input, errors='strict'): + return utf_8.decode(gql_transform_string(input), errors) + + +class GQLIncrementalDecoder(utf_8.IncrementalDecoder): + def decode(self, input, final=False): + self.buffer += input + if final: + buff = self.buffer + self.buffer = '' + return super().decode(gql_transform_string(buff), final=True) + + +class GQLStreamReader(utf_8.StreamReader): + def __init__(self, *args, **kwargs): + super().__init__(self, *args, **kwargs) + self.stream = StringIO(gql_decode(self.stream)) + + +def search_function(encoding): + if encoding != 'gql': return None + # Assume utf8 encoding + utf8 = encodings.search_function('utf8') + return codecs.CodecInfo( + name='gql', + encode=utf8.encode, + decode=gql_decode, + incrementalencoder=utf8.incrementalencoder, + incrementaldecoder=GQLIncrementalDecoder, + streamreader=GQLStreamReader, + streamwriter=utf8.streamwriter) + +codecs.register(search_function) + +_USAGE = """\ +Wraps a python command to allow it to recognize pyxl-coded files with +no source modifications. + +Usage: + python -m gql.codec.register -m module.to.run [args...] + python -m gql.codec.register path/to/script.py [args...] +""" + +if __name__ == '__main__': + script = None + if len(sys.argv) >= 3 and sys.argv[1] == '-m': + mode = 'module' + module = sys.argv[2] + del sys.argv[1:3] + elif len(sys.argv) >= 2: + mode = 'script' + script = sys.argv[1] + sys.argv = sys.argv[1:] + else: + print(_USAGE) + sys.exit(1) + + if mode == 'module': + import runpy + runpy.run_module(module, run_name='__main__', alter_sys=True) + elif mode == 'script': + with open(script) as f: + global __file__ + __file__ = script + # Use globals as our "locals" dictionary so that something + # that tries to import __main__ (e.g. the unittest module) + # will see the right things. + exec(f.read() in globals(), globals()) diff --git a/gql/codec/transform.py b/gql/codec/transform.py new file mode 100644 index 0000000..c86d0a6 --- /dev/null +++ b/gql/codec/transform.py @@ -0,0 +1,46 @@ +from io import BytesIO +from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING + + +def tokenize_python_stream(stream: BytesIO) -> [TokenInfo]: + return tokenize(stream.readline, ) + + +def tokenize_python_string(value: str) -> [TokenInfo]: + stream = BytesIO(value.encode('utf-8')) + return tokenize_python_stream(stream) + + +def untokenize(tokens: [TokenInfo]) -> str: + parts = [] + prev_row = 1 + prev_col = 0 + + for token in tokens: + ttype, tvalue, tstart, tend, tline = token + row, col = tstart + + if ttype == ENCODING: + continue + + assert row == prev_row, 'Unexpected jump in rows on line:%d: %s' % (row, tline) + + # Add whitespace + col_offset = col - prev_col + # assert col_offset >= 0 + if col_offset > 0: + parts.append(' ' * col_offset) + + parts.append(tvalue) + prev_row, prev_col = tend + + if ttype in (NL, NEWLINE): + prev_row += 1 + prev_col = 0 + + if ttype == 'CUSTOM': + parts.append('\n') + prev_col = 0 + + + return ''.join(parts) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index 3df46f0..848d13d 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -13,9 +13,10 @@ class DataclassesRenderer: - def __init__(self, schema: GraphQLSchema, config: Config): + def __init__(self, schema: GraphQLSchema, config: Config, classname_prefix: str = None): self.schema = schema self.config = config + self.classname_prefix = '' or classname_prefix def render(self, parsed_query: ParsedQuery): # We sort fragment nodes to be first and operations to be last because of dependecies @@ -51,6 +52,14 @@ def render(self, parsed_query: ParsedQuery): return str(buffer) + def get_operation_class_name(self, parsed_query: ParsedQuery): + for obj in parsed_query.objects[::-1]: + if isinstance(obj, ParsedOperation): + return obj.name + + raise Exception('No operation defined') + + @staticmethod def __render_enum_field(buffer: CodeChunk): with buffer.write_block('def enum_field(enum_type):'): @@ -75,7 +84,7 @@ def __render_datetime_field(buffer: CodeChunk): def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: ParsedObject): buffer.write('@dataclass_json') buffer.write('@dataclass') - with buffer.write_block(f'class {obj.name}({", ".join(obj.parents)}):'): + with buffer.write_block(f'class {self.classname_prefix}{obj.name}({", ".join(obj.parents)}):'): # render child objects if not obj.children: buffer.write('pass') @@ -91,7 +100,7 @@ def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: Par def __render_operation(self, parsed_query: ParsedQuery, buffer: CodeChunk, parsed_op: ParsedOperation): buffer.write('@dataclass_json') buffer.write('@dataclass') - with buffer.write_block(f'class {parsed_op.name}:'): + with buffer.write_block(f'class {self.classname_prefix}{parsed_op.name}:'): buffer.write('__QUERY__ = """') buffer.write(parsed_query.query) buffer.write('"""') diff --git a/tests/_codec/__init__.py b/tests/_codec/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/_codec/test_register.py b/tests/_codec/test_register.py new file mode 100644 index 0000000..40b20e6 --- /dev/null +++ b/tests/_codec/test_register.py @@ -0,0 +1,33 @@ +import pytest +from gql.codec import register + +from gql.config import Config +from gql.renderer_dataclasses import DataclassesRenderer + +EXAMPLE = """ +# Use gql'' +GetFilm = gql''' + query GetFilm { + film(id: "1") { + title + director + } + } +''' + +result = GetFilm.execute() +film = result.data.film +""" + +@pytest.fixture(autouse=True) +def mock_codec_config(swapi_schema, swapi_parser, mocker): + renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', documents=''), classname_prefix='__') + + mocker.patch.object(register, 'get_schema', return_value=swapi_schema) + mocker.patch.object(register, 'get_parser', return_value=swapi_parser) + mocker.patch.object(register, 'get_renderer', return_value=renderer) + + +def test_gql_transform_string(): + x = register.gql_transform_string(EXAMPLE) + assert x From d815eebbd825bbb069ed96e72a4c87e66385d8ad Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 13:01:52 -0800 Subject: [PATCH 03/35] Add pth file to auto register the codec --- gql.pth | 1 + pyproject.toml | 1 + 2 files changed, 2 insertions(+) create mode 100644 gql.pth diff --git a/gql.pth b/gql.pth new file mode 100644 index 0000000..9fd7cff --- /dev/null +++ b/gql.pth @@ -0,0 +1 @@ +import gql.codec.register diff --git a/pyproject.toml b/pyproject.toml index b776b4c..e4e8641 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "Python GraphQL Client Library" authors = ["Eran Kampf "] license = "MIT" readme = "README.md" +include= ["gql.pth"] [tool.poetry.dependencies] python = "^3.7" From 1be6b7531a6fa8d14d36549d1d272a2d1b0f701a Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 13:05:43 -0800 Subject: [PATCH 04/35] reorg code --- gql/codec/register.py | 85 +------------------ gql/codec/transform.py | 83 +++++++++++++++++- .../{test_register.py => test_transform.py} | 0 3 files changed, 84 insertions(+), 84 deletions(-) rename tests/_codec/{test_register.py => test_transform.py} (100%) diff --git a/gql/codec/register.py b/gql/codec/register.py index 5f57b7f..e896ff8 100644 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -3,89 +3,8 @@ import sys from encodings import utf_8 from io import BytesIO -from tokenize import TokenInfo, NAME, OP -from gql.codec.transform import tokenize_python_stream, untokenize -from gql.config import Config -from gql.query_parser import QueryParser -from gql.renderer_dataclasses import DataclassesRenderer -from gql.utils_schema import load_schema - - -def get_config(): - if 'CONFIG' not in globals(): - globals()['CONFIG'] = Config.load('.gql.json') - - return globals()['CONFIG'] - - -def get_schema(): - if 'SCHEMA' not in globals(): - config = get_config() - globals()['SCHEMA'] = load_schema(config.schema) - - return globals()['SCHEMA'] - - -def get_parser() -> QueryParser: - if 'PARSER' not in globals(): - schema = get_schema() - globals()['PARSER'] = QueryParser(schema) - - return globals()['PARSER'] - - -def get_renderer() -> DataclassesRenderer: - if 'RENDERER' not in globals(): - schema = get_schema() - config = get_config() - globals()['RENDERER'] = DataclassesRenderer(schema, config, classname_prefix='__') - - return globals()['RENDERER'] - - -def gql_transform(stream: BytesIO): - tokens = list(tokenize_python_stream(stream)) - transformed_tokens = [] - - query_started = False - for token in tokens: - if token.type == 1 and token.string == 'gql': # type NAME - query_started = True - continue - - if token.type == 3 and query_started: # type STRING - query_str = token.string.strip("'''") - parsed_query = get_parser().parse(query_str) - rendered = get_renderer().render(parsed_query) - - # verify 2 previous tokens are NAME and OP ('=') - prev_tokens = transformed_tokens[:-2] - gql_tokens = transformed_tokens[-2:] - - if gql_tokens[0].type == NAME and gql_tokens[1].type == OP: - transformed_tokens = prev_tokens - - rendered_token = TokenInfo('CUSTOM', rendered, gql_tokens[0].start, gql_tokens[0].end, gql_tokens[0].line) - transformed_tokens.append(rendered_token) - transformed_tokens.append(gql_tokens[0]) - transformed_tokens.append(gql_tokens[1]) - - op_name = get_renderer().get_operation_class_name(parsed_query) - - transformed_tokens.append(TokenInfo(NAME, op_name, token.start, token.end, token.line)) - continue - - transformed_tokens.append(token) - query_started = False - - result = untokenize(transformed_tokens) - return result.rstrip() - - -def gql_transform_string(input: str): - stream = BytesIO(input.encode('utf-8')) - return gql_transform(stream) +from gql.codec.transform import gql_transform_string def gql_decode(input, errors='strict'): @@ -104,7 +23,7 @@ def decode(self, input, final=False): class GQLStreamReader(utf_8.StreamReader): def __init__(self, *args, **kwargs): super().__init__(self, *args, **kwargs) - self.stream = StringIO(gql_decode(self.stream)) + self.stream = BytesIO(gql_decode(self.stream)) def search_function(encoding): diff --git a/gql/codec/transform.py b/gql/codec/transform.py index c86d0a6..8d35d93 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -1,5 +1,43 @@ from io import BytesIO -from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING +from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING, NAME, OP + +from gql.codec.transform import tokenize_python_stream, untokenize +from gql.config import Config +from gql.query_parser import QueryParser +from gql.renderer_dataclasses import DataclassesRenderer +from gql.utils_schema import load_schema + + +def get_config(): + if 'CONFIG' not in globals(): + globals()['CONFIG'] = Config.load('.gql.json') + + return globals()['CONFIG'] + + +def get_schema(): + if 'SCHEMA' not in globals(): + config = get_config() + globals()['SCHEMA'] = load_schema(config.schema) + + return globals()['SCHEMA'] + + +def get_parser() -> QueryParser: + if 'PARSER' not in globals(): + schema = get_schema() + globals()['PARSER'] = QueryParser(schema) + + return globals()['PARSER'] + + +def get_renderer() -> DataclassesRenderer: + if 'RENDERER' not in globals(): + schema = get_schema() + config = get_config() + globals()['RENDERER'] = DataclassesRenderer(schema, config, classname_prefix='__') + + return globals()['RENDERER'] def tokenize_python_stream(stream: BytesIO) -> [TokenInfo]: @@ -11,6 +49,49 @@ def tokenize_python_string(value: str) -> [TokenInfo]: return tokenize_python_stream(stream) +def gql_transform(stream: BytesIO): + tokens = list(tokenize_python_stream(stream)) + transformed_tokens = [] + + query_started = False + for token in tokens: + if token.type == 1 and token.string == 'gql': # type NAME + query_started = True + continue + + if token.type == 3 and query_started: # type STRING + query_str = token.string.strip("'''") + parsed_query = get_parser().parse(query_str) + rendered = get_renderer().render(parsed_query) + + # verify 2 previous tokens are NAME and OP ('=') + prev_tokens = transformed_tokens[:-2] + gql_tokens = transformed_tokens[-2:] + + if gql_tokens[0].type == NAME and gql_tokens[1].type == OP: + transformed_tokens = prev_tokens + + rendered_token = TokenInfo('CUSTOM', rendered, gql_tokens[0].start, gql_tokens[0].end, gql_tokens[0].line) + transformed_tokens.append(rendered_token) + transformed_tokens.append(gql_tokens[0]) + transformed_tokens.append(gql_tokens[1]) + + op_name = get_renderer().get_operation_class_name(parsed_query) + + transformed_tokens.append(TokenInfo(NAME, op_name, token.start, token.end, token.line)) + continue + + transformed_tokens.append(token) + query_started = False + + result = untokenize(transformed_tokens) + return result.rstrip() + + +def gql_transform_string(input: str): + stream = BytesIO(input.encode('utf-8')) + return gql_transform(stream) + def untokenize(tokens: [TokenInfo]) -> str: parts = [] prev_row = 1 diff --git a/tests/_codec/test_register.py b/tests/_codec/test_transform.py similarity index 100% rename from tests/_codec/test_register.py rename to tests/_codec/test_transform.py From 0d440005e88891c8021e9720e2d27cb92e29a621 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 13:34:44 -0800 Subject: [PATCH 05/35] Wrap queries in their own namespace --- gql/codec/transform.py | 4 ++-- gql/renderer_dataclasses.py | 37 +++++++++++++++++++++++----------- tests/_codec/test_transform.py | 16 +++++++++------ 3 files changed, 37 insertions(+), 20 deletions(-) diff --git a/gql/codec/transform.py b/gql/codec/transform.py index 8d35d93..41c6eee 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -1,7 +1,6 @@ from io import BytesIO from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING, NAME, OP -from gql.codec.transform import tokenize_python_stream, untokenize from gql.config import Config from gql.query_parser import QueryParser from gql.renderer_dataclasses import DataclassesRenderer @@ -78,7 +77,7 @@ def gql_transform(stream: BytesIO): op_name = get_renderer().get_operation_class_name(parsed_query) - transformed_tokens.append(TokenInfo(NAME, op_name, token.start, token.end, token.line)) + transformed_tokens.append(TokenInfo(NAME, f'{op_name}Namespace.{op_name}', token.start, token.end, token.line)) continue transformed_tokens.append(token) @@ -92,6 +91,7 @@ def gql_transform_string(input: str): stream = BytesIO(input.encode('utf-8')) return gql_transform(stream) + def untokenize(tokens: [TokenInfo]) -> str: parts = [] prev_row = 1 diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index 848d13d..762cd7c 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -13,22 +13,20 @@ class DataclassesRenderer: - def __init__(self, schema: GraphQLSchema, config: Config, classname_prefix: str = None): + def __init__(self, schema: GraphQLSchema, config: Config, internal_ns: bool = False): self.schema = schema self.config = config - self.classname_prefix = '' or classname_prefix + self.internal_ns = internal_ns def render(self, parsed_query: ParsedQuery): # We sort fragment nodes to be first and operations to be last because of dependecies buffer = CodeChunk() - buffer.write('# AUTOGENERATED file. Do not Change!') - buffer.write('from functools import partial') - buffer.write('from typing import Any, Callable, Mapping, List') - buffer.write('from enum import Enum') - buffer.write('from dataclasses import dataclass, field') - buffer.write('from dataclasses_json import dataclass_json') - buffer.write('from gql.clients import Client, AsyncIOClient') - buffer.write('') + + if self.internal_ns: + buffer.write(f'class {self.get_operation_class_name(parsed_query)}Namespace(SimpleNamespace):') + buffer.indent() + + self.__render_header(buffer) if self.config.custom_header: buffer.write_lines(self.config.custom_header.split('\n')) @@ -50,6 +48,9 @@ def render(self, parsed_query: ParsedQuery): elif isinstance(obj, ParsedOperation): self.__render_operation(parsed_query, buffer, obj) + if self.internal_ns: + buffer.unindent() + return str(buffer) def get_operation_class_name(self, parsed_query: ParsedQuery): @@ -59,6 +60,18 @@ def get_operation_class_name(self, parsed_query: ParsedQuery): raise Exception('No operation defined') + def __render_header(self, buffer: CodeChunk): + buffer.write('# AUTOGENERATED file. Do not Change!') + buffer.write('from functools import partial') + buffer.write('from typing import Any, Callable, Mapping, List') + buffer.write('from enum import Enum') + buffer.write('from dataclasses import dataclass, field') + buffer.write('from dataclasses_json import dataclass_json') + buffer.write('from gql.clients import Client, AsyncIOClient') + if self.internal_ns: + buffer.write('from types import SimpleNamespace') + buffer.write('') + @staticmethod def __render_enum_field(buffer: CodeChunk): @@ -84,7 +97,7 @@ def __render_datetime_field(buffer: CodeChunk): def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: ParsedObject): buffer.write('@dataclass_json') buffer.write('@dataclass') - with buffer.write_block(f'class {self.classname_prefix}{obj.name}({", ".join(obj.parents)}):'): + with buffer.write_block(f'class {obj.name}({", ".join(obj.parents)}):'): # render child objects if not obj.children: buffer.write('pass') @@ -100,7 +113,7 @@ def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: Par def __render_operation(self, parsed_query: ParsedQuery, buffer: CodeChunk, parsed_op: ParsedOperation): buffer.write('@dataclass_json') buffer.write('@dataclass') - with buffer.write_block(f'class {self.classname_prefix}{parsed_op.name}:'): + with buffer.write_block(f'class {parsed_op.name}:'): buffer.write('__QUERY__ = """') buffer.write(parsed_query.query) buffer.write('"""') diff --git a/tests/_codec/test_transform.py b/tests/_codec/test_transform.py index 40b20e6..c3af918 100644 --- a/tests/_codec/test_transform.py +++ b/tests/_codec/test_transform.py @@ -1,5 +1,7 @@ +from types import SimpleNamespace + import pytest -from gql.codec import register +from gql.codec import transform from gql.config import Config from gql.renderer_dataclasses import DataclassesRenderer @@ -19,15 +21,17 @@ film = result.data.film """ +SimpleNamespace + @pytest.fixture(autouse=True) def mock_codec_config(swapi_schema, swapi_parser, mocker): - renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', documents=''), classname_prefix='__') + renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', documents=''), internal_ns=True) - mocker.patch.object(register, 'get_schema', return_value=swapi_schema) - mocker.patch.object(register, 'get_parser', return_value=swapi_parser) - mocker.patch.object(register, 'get_renderer', return_value=renderer) + mocker.patch.object(transform, 'get_schema', return_value=swapi_schema) + mocker.patch.object(transform, 'get_parser', return_value=swapi_parser) + mocker.patch.object(transform, 'get_renderer', return_value=renderer) def test_gql_transform_string(): - x = register.gql_transform_string(EXAMPLE) + x = transform.gql_transform_string(EXAMPLE) assert x From 30250c0e8a47363a7aeef6adf3515026c36cc7ad Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 13:42:55 -0800 Subject: [PATCH 06/35] Refactor --- gql/renderer_dataclasses.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index 762cd7c..8d5f1bb 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -22,12 +22,12 @@ def render(self, parsed_query: ParsedQuery): # We sort fragment nodes to be first and operations to be last because of dependecies buffer = CodeChunk() + self.__render_header(buffer) + if self.internal_ns: buffer.write(f'class {self.get_operation_class_name(parsed_query)}Namespace(SimpleNamespace):') buffer.indent() - self.__render_header(buffer) - if self.config.custom_header: buffer.write_lines(self.config.custom_header.split('\n')) @@ -146,7 +146,7 @@ def __render_operation(self, parsed_query: ParsedQuery, buffer: CodeChunk, parse buffer.write('@classmethod') with buffer.write_block(f'async def execute_async(cls, {vars_args} on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None):'): - buffer.write(f'client = AsyncClient(\'{self.config.schema}\')') + buffer.write(f'client = AsyncIOClient(\'{self.config.schema}\')') buffer.write(f'variables = {variables_dict}') buffer.write(f'response_text = await client.call(cls.__QUERY__, variables=variables, on_before_callback=on_before_callback)') buffer.write(f'return cls.from_json(response_text)') From aa987b9b35f2481c4a14a3a393335cf7b6822ccc Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 15:06:45 -0800 Subject: [PATCH 07/35] Sync client shouldnt be async --- gql/clients/sync.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gql/clients/sync.py b/gql/clients/sync.py index b6fcb0c..559f2af 100644 --- a/gql/clients/sync.py +++ b/gql/clients/sync.py @@ -15,7 +15,7 @@ def __init__(self, endpoint, headers=None): 'Accept-Encoding': 'gzip', } - async def call(self, query, + def call(self, query, variables=None, return_json=False, on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None) -> Union[dict, str]: From 5b46ae90f961b56db9ea5f99d69ba1ebf64c6adc Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 15:07:13 -0800 Subject: [PATCH 08/35] Codec example --- examples/swapi/.gql.json | 5 + examples/swapi/swapi-schema.graphql | 5305 +++++++++++++++++++++++++++ examples/swapi/usage_with_codec.py | 12 + gql/codec/register.py | 23 +- gql/codec/transform.py | 4 +- 5 files changed, 5339 insertions(+), 10 deletions(-) create mode 100644 examples/swapi/.gql.json create mode 100644 examples/swapi/swapi-schema.graphql create mode 100644 examples/swapi/usage_with_codec.py mode change 100644 => 100755 gql/codec/register.py diff --git a/examples/swapi/.gql.json b/examples/swapi/.gql.json new file mode 100644 index 0000000..3bd514a --- /dev/null +++ b/examples/swapi/.gql.json @@ -0,0 +1,5 @@ +{ + "schema": "/Users/ekampf/workspace/ebates/innovation/gql/tests/fixtures/swapi-schema.graphql", + "documents": "./tests/**/*.gql", + "custom_header_exports": "" +} diff --git a/examples/swapi/swapi-schema.graphql b/examples/swapi/swapi-schema.graphql new file mode 100644 index 0000000..291be97 --- /dev/null +++ b/examples/swapi/swapi-schema.graphql @@ -0,0 +1,5305 @@ +{ + "__schema": { + "queryType": { + "name": "Query" + }, + "mutationType": { + "name": "Mutation" + }, + "subscriptionType": null, + "types": [ + { + "kind": "OBJECT", + "name": "Query", + "description": null, + "fields": [ + { + "name": "allFilms", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allSpecies", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SpecieConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allCharacters", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allVehicles", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "VehicleConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allPlanets", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PlanetConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allStarships", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "StarshipConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "allHeroes", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name_Contains", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "HeroConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "film", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Film", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "specie", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Specie", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "character", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Person", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vehicle", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Vehicle", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "planet", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starship", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Starship", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hero", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Hero", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The ID of the object", + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "viewer", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Query", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FilmConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "FilmEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PageInfo", + "description": null, + "fields": [ + { + "name": "hasNextPage", + "description": "When paginating forwards, are there more items?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasPreviousPage", + "description": "When paginating backwards, are there more items?", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startCursor", + "description": "When paginating backwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endCursor", + "description": "When paginating forwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Boolean", + "description": "The `Boolean` scalar type represents `true` or `false`.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "String", + "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "FilmEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Film", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Film", + "description": null, + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "episodeId", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "openingCrawl", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "director", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "releaseDate", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "characters", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "planets", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PlanetConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starships", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "StarshipConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vehicles", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "VehicleConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "species", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SpecieConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "producers", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "description": "An object with an ID", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Film", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Person", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Hero", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Specie", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Starship", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Vehicle", + "ofType": null + } + ] + }, + { + "kind": "SCALAR", + "name": "ID", + "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Int", + "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^53 - 1) and 2^53 - 1 since represented in JSON as double-precision floating point numbers specifiedby [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "DateTime", + "description": "\n The `DateTime` scalar type represents a DateTime\n value as specified by\n [iso8601](https://en.wikipedia.org/wiki/ISO_8601).\n ", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PersonConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PersonEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PersonEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Person", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Person", + "description": "An individual person or character within the Star Wars universe.", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mass", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hairColor", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "skinColor", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eyeColor", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "birthYear", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "homeworld", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starships", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "StarshipConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vehicles", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "VehicleConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "species", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SpecieConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Planet", + "description": "A large mass, planet or planetoid in the Star Wars Universe,\n at the time of 0 ABY.", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rotationPeriod", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orbitalPeriod", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "diameter", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gravity", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "surfaceWater", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "population", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "heroes", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name_Contains", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "HeroConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "residents", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "species", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SpecieConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "climates", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "terrains", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HeroConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "HeroEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HeroEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Hero", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Hero", + "description": "A hero created by fans", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "homeworld", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SpecieConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SpecieEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SpecieEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Specie", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Specie", + "description": "A type of person or character within the Star Wars Universe.", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "classification", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "designation", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "averageHeight", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "averageLifespan", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "homeworld", + "description": "", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "language", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "people", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "species", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SpecieConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eyeColors", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hairColors", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "skinColors", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Float", + "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StarshipConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "StarshipEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "StarshipEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Starship", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Starship", + "description": "A single transport craft that has hyperdrive capability.", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "model", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "manufacturer", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "costInCredits", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "length", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maxAtmospheringSpeed", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "crew", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "passengers", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cargoCapacity", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consumables", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hyperdriveRating", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MGLT", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starshipClass", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pilots", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "starships", + "description": null, + "args": [ + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "StarshipConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "manufacturers", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "VehicleConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "VehicleEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "VehicleEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Vehicle", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Vehicle", + "description": "A single transport craft that does not have hyperdrive capability", + "fields": [ + { + "name": "id", + "description": "The ID of the object.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "model", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "manufacturer", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "costInCredits", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "length", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maxAtmospheringSpeed", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "crew", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "passengers", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cargoCapacity", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "consumables", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vehicleClass", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pilots", + "description": null, + "args": [ + { + "name": "name", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PersonConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "vehicles", + "description": null, + "args": [ + { + "name": "name_Startswith", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "VehicleConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "films", + "description": null, + "args": [ + { + "name": "episodeId_Gt", + "description": "Filter", + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "before", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "after", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "last", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "FilmConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "manufacturers", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PlanetConnection", + "description": null, + "fields": [ + { + "name": "pageInfo", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "edges", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PlanetEdge", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PlanetEdge", + "description": null, + "fields": [ + { + "name": "node", + "description": "The item at the end of the edge", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Planet", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cursor", + "description": "A cursor for use in pagination", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DjangoDebug", + "description": null, + "fields": [ + { + "name": "sql", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "DjangoDebugSQL", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DjangoDebugSQL", + "description": null, + "fields": [ + { + "name": "vendor", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sql", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "duration", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rawSql", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "params", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startTime", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stopTime", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isSlow", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isSelect", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "transId", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "transStatus", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isoLevel", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "encoding", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Mutation", + "description": null, + "fields": [ + { + "name": "createHero", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "CreateHeroPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CreateHeroPayload", + "description": null, + "fields": [ + { + "name": "hero", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "Hero", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ok", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "clientMutationId", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation and subscription operations.", + "fields": [ + { + "name": "types", + "description": "A list of all types supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Directive", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "fields": [ + { + "name": "kind", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fields", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Field", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interfaces", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "possibleTypes", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumValues", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__EnumValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inputFields", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ofType", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SCALAR", + "description": "Indicates this type is a scalar.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LIST", + "description": "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NON_NULL", + "description": "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "defaultValue", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locations", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__DirectiveLocation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "onOperation", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onFragment", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onField", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "QUERY", + "description": "Location adjacent to a query operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUTATION", + "description": "Location adjacent to a mutation operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIPTION", + "description": "Location adjacent to a subscription operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD", + "description": "Location adjacent to a field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_DEFINITION", + "description": "Location adjacent to a fragment definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_SPREAD", + "description": "Location adjacent to a fragment spread.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INLINE_FRAGMENT", + "description": "Location adjacent to an inline fragment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCHEMA", + "description": "Location adjacent to a schema definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCALAR", + "description": "Location adjacent to a scalar definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Location adjacent to an object definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD_DEFINITION", + "description": "Location adjacent to a field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ARGUMENT_DEFINITION", + "description": "Location adjacent to an argument definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Location adjacent to an interface definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Location adjacent to a union definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Location adjacent to an enum definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM_VALUE", + "description": "Location adjacent to an enum value definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Location adjacent to an input object definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_FIELD_DEFINITION", + "description": "Location adjacent to an input object field definition.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + } + ], + "directives": [ + { + "name": "include", + "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Included when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + }, + { + "name": "skip", + "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Skipped when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ] + } + ] + } +} diff --git a/examples/swapi/usage_with_codec.py b/examples/swapi/usage_with_codec.py new file mode 100644 index 0000000..d3ad97e --- /dev/null +++ b/examples/swapi/usage_with_codec.py @@ -0,0 +1,12 @@ +# -*- coding: gql -*- + +GET_FILM = gql''' + query GetFilm($theFilmID: ID!) { + film(id: $theFilmID) { + title + director + } + } +''' + +GET_FILM.execute('ZmlsbXM6MQ==') diff --git a/gql/codec/register.py b/gql/codec/register.py old mode 100644 new mode 100755 index e896ff8..be90273 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -1,23 +1,25 @@ #!/usr/bin/env python -import codecs, encodings +import codecs +import encodings import sys from encodings import utf_8 from io import BytesIO -from gql.codec.transform import gql_transform_string +from gql.codec.transform import gql_transform, gql_transform_string def gql_decode(input, errors='strict'): - return utf_8.decode(gql_transform_string(input), errors) + return utf_8.decode(input) + # return utf_8.decode(gql_transform_string(input), errors) class GQLIncrementalDecoder(utf_8.IncrementalDecoder): - def decode(self, input, final=False): + def decode(self, input: bytes, final: bool=False): self.buffer += input if final: buff = self.buffer self.buffer = '' - return super().decode(gql_transform_string(buff), final=True) + return gql_transform(BytesIO(buff)) class GQLStreamReader(utf_8.StreamReader): @@ -27,7 +29,9 @@ def __init__(self, *args, **kwargs): def search_function(encoding): - if encoding != 'gql': return None + if encoding != 'gql': + return None + # Assume utf8 encoding utf8 = encodings.search_function('utf8') return codecs.CodecInfo( @@ -39,6 +43,7 @@ def search_function(encoding): streamreader=GQLStreamReader, streamwriter=utf8.streamwriter) + codecs.register(search_function) _USAGE = """\ @@ -68,10 +73,12 @@ def search_function(encoding): import runpy runpy.run_module(module, run_name='__main__', alter_sys=True) elif mode == 'script': - with open(script) as f: + with open(script, encoding='gql') as f: global __file__ __file__ = script # Use globals as our "locals" dictionary so that something # that tries to import __main__ (e.g. the unittest module) # will see the right things. - exec(f.read() in globals(), globals()) + code = f.read() + print(code) + exec(code, globals()) diff --git a/gql/codec/transform.py b/gql/codec/transform.py index 41c6eee..cbdd9cb 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -34,13 +34,13 @@ def get_renderer() -> DataclassesRenderer: if 'RENDERER' not in globals(): schema = get_schema() config = get_config() - globals()['RENDERER'] = DataclassesRenderer(schema, config, classname_prefix='__') + globals()['RENDERER'] = DataclassesRenderer(schema, config, internal_ns=True) return globals()['RENDERER'] def tokenize_python_stream(stream: BytesIO) -> [TokenInfo]: - return tokenize(stream.readline, ) + return tokenize(stream.readline) def tokenize_python_string(value: str) -> [TokenInfo]: From bd8029e84bfcb7e55576dc419dc4ee29338599d8 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 15:20:08 -0800 Subject: [PATCH 09/35] Added encpoint to example --- examples/swapi/.gql.json | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/swapi/.gql.json b/examples/swapi/.gql.json index 3bd514a..1cb3137 100644 --- a/examples/swapi/.gql.json +++ b/examples/swapi/.gql.json @@ -1,5 +1,6 @@ { "schema": "/Users/ekampf/workspace/ebates/innovation/gql/tests/fixtures/swapi-schema.graphql", + "endpoint": "http://swapi.graphene-python.org/graphql", "documents": "./tests/**/*.gql", "custom_header_exports": "" } From 09156f8a92135782ddec2a8b0ef551b7710537e3 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 2 Jan 2019 17:20:42 -0800 Subject: [PATCH 10/35] Fix scripts section in project --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e4e8641..04481c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ pytest-mock = "^1.10" deepdiff = "^3.3" [tool.poetry.scripts] -my-script = 'gql:cli' +gql = 'gql.cli:cli' [build-system] requires = ["poetry>=0.12"] From 1746bdb737c9ccbbcb2b7fd3a382e59af3b657a6 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 3 Jan 2019 09:15:04 -0800 Subject: [PATCH 11/35] lint --- gql/clients/sync.py | 6 +++--- gql/codec/register.py | 30 ++++++++++++++++++++---------- gql/codec/transform.py | 4 ++-- gql/renderer_dataclasses.py | 3 ++- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/gql/clients/sync.py b/gql/clients/sync.py index 559f2af..9f8e3e2 100644 --- a/gql/clients/sync.py +++ b/gql/clients/sync.py @@ -16,9 +16,9 @@ def __init__(self, endpoint, headers=None): } def call(self, query, - variables=None, - return_json=False, - on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None) -> Union[dict, str]: + variables=None, + return_json=False, + on_before_callback: Callable[[Mapping[str, str], Mapping[str, str]], None] = None) -> Union[dict, str]: headers = self.__headers.copy() diff --git a/gql/codec/register.py b/gql/codec/register.py index be90273..a158e9f 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -1,28 +1,31 @@ #!/usr/bin/env python +import sys import codecs import encodings -import sys from encodings import utf_8 from io import BytesIO -from gql.codec.transform import gql_transform, gql_transform_string +from gql.codec.transform import gql_transform -def gql_decode(input, errors='strict'): - return utf_8.decode(input) - # return utf_8.decode(gql_transform_string(input), errors) +def gql_decode(value, **_): + return utf_8.decode(value) class GQLIncrementalDecoder(utf_8.IncrementalDecoder): - def decode(self, input: bytes, final: bool=False): + def decode(self, input: bytes, final: bool = False): # pylint:disable=redefined-builtin self.buffer += input if final: buff = self.buffer self.buffer = '' return gql_transform(BytesIO(buff)) + return None + class GQLStreamReader(utf_8.StreamReader): + # pylint:disable=abstract-method + def __init__(self, *args, **kwargs): super().__init__(self, *args, **kwargs) self.stream = BytesIO(gql_decode(self.stream)) @@ -41,7 +44,8 @@ def search_function(encoding): incrementalencoder=utf8.incrementalencoder, incrementaldecoder=GQLIncrementalDecoder, streamreader=GQLStreamReader, - streamwriter=utf8.streamwriter) + streamwriter=utf8.streamwriter + ) codecs.register(search_function) @@ -55,7 +59,9 @@ def search_function(encoding): python -m gql.codec.register path/to/script.py [args...] """ -if __name__ == '__main__': + +def main(): + # pylint:disable=exec-used,redefined-builtin,global-statement script = None if len(sys.argv) >= 3 and sys.argv[1] == '-m': mode = 'module' @@ -73,12 +79,16 @@ def search_function(encoding): import runpy runpy.run_module(module, run_name='__main__', alter_sys=True) elif mode == 'script': - with open(script, encoding='gql') as f: + with open(script) as file: global __file__ __file__ = script # Use globals as our "locals" dictionary so that something # that tries to import __main__ (e.g. the unittest module) # will see the right things. - code = f.read() + code = file.read() print(code) exec(code, globals()) + + +if __name__ == '__main__': + main() diff --git a/gql/codec/transform.py b/gql/codec/transform.py index cbdd9cb..fe17a5b 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -87,8 +87,8 @@ def gql_transform(stream: BytesIO): return result.rstrip() -def gql_transform_string(input: str): - stream = BytesIO(input.encode('utf-8')) +def gql_transform_string(value: str): + stream = BytesIO(value.encode('utf-8')) return gql_transform(stream) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index 53b65c1..bacc594 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -53,7 +53,8 @@ def render(self, parsed_query: ParsedQuery): return str(buffer) - def get_operation_class_name(self, parsed_query: ParsedQuery): + @staticmethod + def get_operation_class_name(parsed_query: ParsedQuery): for obj in parsed_query.objects[::-1]: if isinstance(obj, ParsedOperation): return obj.name From 221a87a5c69d8638be29b7a6f80253897e095d48 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 3 Jan 2019 09:31:23 -0800 Subject: [PATCH 12/35] Fix tests --- tests/_codec/test_transform.py | 3 +-- tests/test_renderer_dataclasses.py | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/_codec/test_transform.py b/tests/_codec/test_transform.py index c3af918..3fa10da 100644 --- a/tests/_codec/test_transform.py +++ b/tests/_codec/test_transform.py @@ -21,11 +21,10 @@ film = result.data.film """ -SimpleNamespace @pytest.fixture(autouse=True) def mock_codec_config(swapi_schema, swapi_parser, mocker): - renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', documents=''), internal_ns=True) + renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', endpoint='schemaurl', documents=''), internal_ns=True) mocker.patch.object(transform, 'get_schema', return_value=swapi_schema) mocker.patch.object(transform, 'get_parser', return_value=swapi_parser) diff --git a/tests/test_renderer_dataclasses.py b/tests/test_renderer_dataclasses.py index 4f173a4..2a171fb 100644 --- a/tests/test_renderer_dataclasses.py +++ b/tests/test_renderer_dataclasses.py @@ -1,6 +1,5 @@ import pytest from datetime import datetime -from dataclasses import field from gql.config import Config from gql.renderer_dataclasses import DataclassesRenderer From ce546d188214bb18e97a9673a474b76f16bfbec1 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 3 Jan 2019 12:33:55 -0800 Subject: [PATCH 13/35] nicer code --- gql/codec/transform.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gql/codec/transform.py b/gql/codec/transform.py index fe17a5b..1430d76 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -1,5 +1,5 @@ from io import BytesIO -from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING, NAME, OP +from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING, NAME, OP, STRING from gql.config import Config from gql.query_parser import QueryParser @@ -54,11 +54,11 @@ def gql_transform(stream: BytesIO): query_started = False for token in tokens: - if token.type == 1 and token.string == 'gql': # type NAME + if token.type == NAME and token.string == 'gql': query_started = True continue - if token.type == 3 and query_started: # type STRING + if token.type == STRING and query_started: query_str = token.string.strip("'''") parsed_query = get_parser().parse(query_str) rendered = get_renderer().render(parsed_query) From 0d0f6d41cf1d024bc1f4ade78d6c6d552938fa97 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 3 Jan 2019 12:34:31 -0800 Subject: [PATCH 14/35] Unnecessary --- gql/query_parser.py | 1 - 1 file changed, 1 deletion(-) diff --git a/gql/query_parser.py b/gql/query_parser.py index 94aa59b..3f4c6e9 100644 --- a/gql/query_parser.py +++ b/gql/query_parser.py @@ -224,7 +224,6 @@ def __init__(self, errors): class QueryParser: def __init__(self, schema: GraphQLSchema): self.schema = schema - self.__jinja2_env = None def parse(self, query: str, should_validate: bool = True) -> ParsedQuery: document_ast = parse(query) From 995c2b5e14f1f29444240622c507c30673b6acd8 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 3 Jan 2019 12:34:49 -0800 Subject: [PATCH 15/35] TODOs --- gql/renderer_dataclasses.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index bacc594..4704591 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -41,7 +41,7 @@ def render(self, parsed_query: ParsedQuery): for enum in parsed_query.enums: self.__render_enum(buffer, enum) - # Iterate in reverse so that operation is last + # Iterate in reverse so that operation is last # TODO - sort by type and not assume operation is first in file for obj in parsed_query.objects[::-1]: if isinstance(obj, ParsedObject): self.__render_object(parsed_query, buffer, obj) @@ -100,7 +100,7 @@ def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: Par buffer.write('@dataclass') with buffer.write_block(f'class {obj.name}({", ".join(obj.parents)}):'): # render child objects - if not obj.children: + if not obj.children: # TODO: if it has fields no need to pass buffer.write('pass') else: for child_object in obj.children: @@ -167,11 +167,11 @@ def __render_field(parsed_query: ParsedQuery, buffer: CodeChunk, field: ParsedFi enum_names = [e.name for e in parsed_query.enums] is_enum = field.type in enum_names if is_enum: - buffer.write(f'{field.name}: {field.type} = enum_field({field.type})') + buffer.write(f'{field.name}: {field.type} = enum_field({field.type})') # TODO: enum default value? return if field.type == 'DateTime': - buffer.write(f'{field.name}: datetime = DATETIME_FIELD') + buffer.write(f'{field.name}: datetime = DATETIME_FIELD') # TODO: datetime default value? return if field.nullable: From 6d80401092a11b4dac4097f7f6356b2a0ae2c6cb Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Mon, 7 Jan 2019 15:41:37 -0800 Subject: [PATCH 16/35] Missing space --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 04481c6..8ecbade 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ description = "Python GraphQL Client Library" authors = ["Eran Kampf "] license = "MIT" readme = "README.md" -include= ["gql.pth"] +include = ["gql.pth"] [tool.poetry.dependencies] python = "^3.7" From cab9b6ba75c6ca492bdf88c004f14b59a19c4209 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Mon, 7 Jan 2019 15:43:05 -0800 Subject: [PATCH 17/35] Codec synonyms --- gql/codec/register.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gql/codec/register.py b/gql/codec/register.py index a158e9f..1493f24 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -32,13 +32,13 @@ def __init__(self, *args, **kwargs): def search_function(encoding): - if encoding != 'gql': + if encoding not in ('gql', 'graphql', 'pygql'): return None # Assume utf8 encoding utf8 = encodings.search_function('utf8') return codecs.CodecInfo( - name='gql', + name=encoding, encode=utf8.encode, decode=gql_decode, incrementalencoder=utf8.incrementalencoder, From 0713f649a8b356fec33ff3a10789149ff36e5377 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Mon, 7 Jan 2019 15:43:50 -0800 Subject: [PATCH 18/35] Fix usage text --- gql/codec/register.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gql/codec/register.py b/gql/codec/register.py index 1493f24..4fd5d2b 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -51,7 +51,7 @@ def search_function(encoding): codecs.register(search_function) _USAGE = """\ -Wraps a python command to allow it to recognize pyxl-coded files with +Wraps a python command to allow it to recognize GraphQL-coded files with no source modifications. Usage: From c125c2e18413529f801a9d8e4970e1ddd516643d Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Mon, 7 Jan 2019 16:03:32 -0800 Subject: [PATCH 19/35] More tests --- tests/test_renderer_dataclasses.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/test_renderer_dataclasses.py b/tests/test_renderer_dataclasses.py index 6e76863..ab4adbb 100644 --- a/tests/test_renderer_dataclasses.py +++ b/tests/test_renderer_dataclasses.py @@ -18,6 +18,26 @@ def github_dataclass_renderer(swapi_schema): return DataclassesRenderer(swapi_schema, Config(schema='schemaurl', endpoint='schemaurl', documents='')) +def test_renders_custom_headers(swapi_schema, swapi_parser, module_compiler): + query = """ + query GetFilm { + returnOfTheJedi: film(id: "1") { + title + director + } + } + """ + + custom_header = '# Works!' + renderer = DataclassesRenderer(swapi_schema, Config(schema='schemaurl', endpoint='schemaurl', documents='', custom_header=custom_header)) + + parsed = swapi_parser.parse(query) + rendered = renderer.render(parsed) + + assert rendered + assert custom_header in rendered + + def test_simple_query(swapi_dataclass_renderer, swapi_parser, module_compiler): query = """ query GetFilm { From 2896860eb90c0122829f0ff87c4403e143fdda8d Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:30:37 -0800 Subject: [PATCH 20/35] faster register function --- gql.pth | 2 +- gql/codec/fast_register.py | 12 ++++++++++++ gql/codec/register.py | 16 +++++++++++++--- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 gql/codec/fast_register.py diff --git a/gql.pth b/gql.pth index 9fd7cff..1053b43 100644 --- a/gql.pth +++ b/gql.pth @@ -1 +1 @@ -import gql.codec.register +import gql.codec.fast_register diff --git a/gql/codec/fast_register.py b/gql/codec/fast_register.py new file mode 100644 index 0000000..5069b96 --- /dev/null +++ b/gql/codec/fast_register.py @@ -0,0 +1,12 @@ +import codecs + + +def search_function(encoding): + if encoding not in ('gql', 'graphql', 'pygql'): + return None + + import gql.codec.register + return gql.codec.register.search_function(encoding) + + +codecs.register(search_function) diff --git a/gql/codec/register.py b/gql/codec/register.py index 4fd5d2b..c00425b 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -7,9 +7,19 @@ from gql.codec.transform import gql_transform +DEFAULT_RESULT = None + def gql_decode(value, **_): - return utf_8.decode(value) + if isinstance(value, memoryview): + value = value.tobytes().decode("utf-8") + + # strip the gql coding line from code so that the python tokenizer can read the code + value = '# coding: utf-8\n' + value + + bio = BytesIO(value.encode('utf-8')) + result = gql_transform(bio) + return result, len(result) class GQLIncrementalDecoder(utf_8.IncrementalDecoder): @@ -20,7 +30,7 @@ def decode(self, input: bytes, final: bool = False): # pylint:disable=redefined self.buffer = '' return gql_transform(BytesIO(buff)) - return None + return DEFAULT_RESULT class GQLStreamReader(utf_8.StreamReader): @@ -48,7 +58,7 @@ def search_function(encoding): ) -codecs.register(search_function) +import gql.codec.fast_register _USAGE = """\ Wraps a python command to allow it to recognize GraphQL-coded files with From f7c7d0d1f277080ba0fb4f7f28fb03936a340162 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:30:53 -0800 Subject: [PATCH 21/35] Updated dataclasses-json --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8ecbade..f7c9d1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ graphql-core-next = "~=1.0.1" requests = "^2.21" jinja2 = "^2.10" inflection = "^0.3.1" -dataclasses-json = "^0.2.0" +dataclasses-json = "^0.2.1" aiohttp = {version = "^3.5", optional = true} watchdog = "^0.9.0" From f056aaa611c642fd7513df8b5d89a90250e87232 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:31:06 -0800 Subject: [PATCH 22/35] =?UTF-8?q?Support=20=E2=80=9C=E2=80=9D=E2=80=9D=20s?= =?UTF-8?q?tring=20literals=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gql/codec/transform.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gql/codec/transform.py b/gql/codec/transform.py index 1430d76..b70c921 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -59,7 +59,7 @@ def gql_transform(stream: BytesIO): continue if token.type == STRING and query_started: - query_str = token.string.strip("'''") + query_str = token.string.strip("'''").strip('"""') parsed_query = get_parser().parse(query_str) rendered = get_renderer().render(parsed_query) From f827c6b53d7a0bcdd6ea45609831293c70a40987 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:31:17 -0800 Subject: [PATCH 23/35] Errors should be optional --- gql/renderer_dataclasses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index c048f8d..2233d05 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -58,7 +58,7 @@ def get_operation_class_name(parsed_query: ParsedQuery): def __render_header(self, buffer: CodeChunk): buffer.write('# AUTOGENERATED file. Do not Change!') buffer.write('from functools import partial') - buffer.write('from typing import Any, Callable, Mapping, List') + buffer.write('from typing import Optional, Any, Callable, Mapping, List') buffer.write('from enum import Enum') buffer.write('from dataclasses import dataclass, field') buffer.write('from dataclasses_json import dataclass_json') @@ -126,7 +126,7 @@ def __render_operation(self, parsed_query: ParsedQuery, buffer: CodeChunk, parse # operation fields buffer.write('') buffer.write(f'data: {parsed_op.name}Data = None') - buffer.write('errors: Any = None') + buffer.write('errors: Optional[Any] = None') buffer.write('') # Execution functions From 52229dd7447c01f36e413fd19d5d93f03978cbf1 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:32:58 -0800 Subject: [PATCH 24/35] Ignore .venv --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7de0d31..286f297 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ Icon* # Temporary virtual environment files /.cache/ -/.venv/ +.venv # Temporary server files .env From 81686c6625b43e7262537238d0a896ddcc582593 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:40:42 -0800 Subject: [PATCH 25/35] Simple example showing embedded query --- examples/simple/.gql.json | 6 ++++++ examples/simple/bootstrap.py | 4 ++++ examples/simple/client.py | 14 ++++++++++++++ examples/simple/requirements.txt | 6 ++++++ examples/simple/server.py | 15 +++++++++++++++ examples/simple/start-server.sh | 1 + 6 files changed, 46 insertions(+) create mode 100644 examples/simple/.gql.json create mode 100644 examples/simple/bootstrap.py create mode 100755 examples/simple/client.py create mode 100644 examples/simple/requirements.txt create mode 100644 examples/simple/server.py create mode 100755 examples/simple/start-server.sh diff --git a/examples/simple/.gql.json b/examples/simple/.gql.json new file mode 100644 index 0000000..7b45988 --- /dev/null +++ b/examples/simple/.gql.json @@ -0,0 +1,6 @@ +{ + "schema": "http://localhost:5000/graphql", + "endpoint": "http://localhost:5000/graphql", + "documents": "./tests/**/*.gql", + "custom_header_exports": "" +} diff --git a/examples/simple/bootstrap.py b/examples/simple/bootstrap.py new file mode 100644 index 0000000..8e4e939 --- /dev/null +++ b/examples/simple/bootstrap.py @@ -0,0 +1,4 @@ +import gql.codec.fast_register + +import client +client.main() \ No newline at end of file diff --git a/examples/simple/client.py b/examples/simple/client.py new file mode 100755 index 0000000..2f4b9a8 --- /dev/null +++ b/examples/simple/client.py @@ -0,0 +1,14 @@ +# coding: gql + +MY_QUERY = gql""" +query hello_query { + hello(argument: "World") +} +""" + +def main(): + result = MY_QUERY.execute() + print(result) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/examples/simple/requirements.txt b/examples/simple/requirements.txt new file mode 100644 index 0000000..ba2a0ce --- /dev/null +++ b/examples/simple/requirements.txt @@ -0,0 +1,6 @@ +flask +flask-graphql +graphene~=2.1.3 + + +pip install ./../../../dist/gql-0.1.0-py3-none-any.whl diff --git a/examples/simple/server.py b/examples/simple/server.py new file mode 100644 index 0000000..0eacc7c --- /dev/null +++ b/examples/simple/server.py @@ -0,0 +1,15 @@ +import graphene +from flask_graphql import GraphQLView +from flask import Flask + +class Query(graphene.ObjectType): + hello = graphene.String(argument=graphene.String(default_value="stranger")) + + def resolve_hello(self, info, argument): + return 'Hello ' + argument + +schema = graphene.Schema(query=Query) + + +app = Flask(__name__) +app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True)) \ No newline at end of file diff --git a/examples/simple/start-server.sh b/examples/simple/start-server.sh new file mode 100755 index 0000000..47d5a82 --- /dev/null +++ b/examples/simple/start-server.sh @@ -0,0 +1 @@ +FLASK_APP=server.py flask run From 6482195d1f0bc17b78d12ad06369543159b5d08b Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 11:41:06 -0800 Subject: [PATCH 26/35] poetry update --- poetry.lock | 82 ++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/poetry.lock b/poetry.lock index 01aa4b7..66e96ea 100644 --- a/poetry.lock +++ b/poetry.lock @@ -4,7 +4,7 @@ description = "Async http client/server framework (asyncio)" name = "aiohttp" optional = true python-versions = ">=3.5.3" -version = "3.5.1" +version = "3.5.4" [package.dependencies] async-timeout = ">=3.0,<4.0" @@ -36,7 +36,7 @@ description = "A few extensions to pyyaml." name = "aspy.yaml" optional = false python-versions = "*" -version = "1.1.1" +version = "1.1.2" [package.dependencies] pyyaml = "*" @@ -68,7 +68,7 @@ description = "Atomic file writes." name = "atomicwrites" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.2.1" +version = "1.3.0" [[package]] category = "main" @@ -108,7 +108,7 @@ description = "Validate configuration and produce human readable error messages. name = "cfgv" optional = false python-versions = "*" -version = "1.1.0" +version = "1.4.0" [package.dependencies] six = "*" @@ -152,7 +152,7 @@ description = "Easily serialize dataclasses to and from JSON" name = "dataclasses-json" optional = false python-versions = ">=3.6" -version = "0.2.0" +version = "0.2.1" [package.dependencies] marshmallow = ">=3.0.0b20" @@ -162,8 +162,8 @@ category = "dev" description = "Better living through Python with decorators" name = "decorator" optional = false -python-versions = "*" -version = "4.3.0" +python-versions = ">=2.6, !=3.0.*, !=3.1.*" +version = "4.3.2" [[package]] category = "dev" @@ -202,7 +202,7 @@ description = "File identification library for Python" name = "identify" optional = false python-versions = "*" -version = "1.1.8" +version = "1.2.1" [[package]] category = "main" @@ -296,7 +296,7 @@ description = "Python library for serializing any arbitrary object graph into JS name = "jsonpickle" optional = false python-versions = "*" -version = "1.0" +version = "1.1" [[package]] category = "dev" @@ -320,7 +320,7 @@ description = "A lightweight library for converting complex datatypes to and fro name = "marshmallow" optional = false python-versions = "*" -version = "3.0.0rc1" +version = "3.0.0rc3" [[package]] category = "dev" @@ -363,7 +363,7 @@ description = "A Python Parser" name = "parso" optional = false python-versions = "*" -version = "0.3.1" +version = "0.3.3" [[package]] category = "main" @@ -399,7 +399,7 @@ description = "plugin and hook calling mechanisms for python" name = "pluggy" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "0.8.0" +version = "0.8.1" [[package]] category = "dev" @@ -427,7 +427,7 @@ description = "Library for building powerful interactive command lines in Python name = "prompt-toolkit" optional = false python-versions = "*" -version = "2.0.7" +version = "2.0.8" [package.dependencies] six = ">=1.9.0" @@ -478,7 +478,7 @@ description = "pytest: simple powerful testing with Python" name = "pytest" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "4.0.2" +version = "4.2.0" [package.dependencies] atomicwrites = ">=1.0" @@ -496,11 +496,11 @@ description = "Pytest plugin for measuring coverage." name = "pytest-cov" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.6.0" +version = "2.6.1" [package.dependencies] coverage = ">=4.4" -pytest = ">=2.9" +pytest = ">=3.6" [[package]] category = "dev" @@ -508,7 +508,7 @@ description = "Describe-style plugin for pytest" name = "pytest-describe" optional = false python-versions = "*" -version = "0.11.1" +version = "0.12.0" [package.dependencies] pytest = ">=2.6.0" @@ -527,7 +527,7 @@ description = "Thin-wrapper around the mock package for easier use with py.test" name = "pytest-mock" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.10.0" +version = "1.10.1" [package.dependencies] pytest = ">=2.7" @@ -549,7 +549,7 @@ description = "Extensions to the standard Python datetime module" name = "python-dateutil" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -version = "2.7.5" +version = "2.8.0" [package.dependencies] six = ">=1.5" @@ -627,7 +627,7 @@ description = "Virtual Python Environment builder" name = "virtualenv" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "16.2.0" +version = "16.3.0" [package.dependencies] setuptools = ">=18.0.0" @@ -659,7 +659,7 @@ description = "Module for decorators, wrappers and monkey patching." name = "wrapt" optional = false python-versions = "*" -version = "1.10.11" +version = "1.11.1" [[package]] category = "main" @@ -685,32 +685,32 @@ version = "0.3.3" async = ["aiohttp"] [metadata] -content-hash = "0df2d2ed429de08447f74874d910f9196a397f000716f226753e29773bdecda6" +content-hash = "8dbe3340bad2cc40200a07bc25718ee6be726db110d42daab99b2ad7b016f7b8" python-versions = "^3.7" [metadata.hashes] -aiohttp = ["0bbaec0b171b1ea77d34bc7c49db71a15e511ef34c45065fd2c7fad8daf1483f", "168f0ecc91200784467479765eb26a80d6d9cf0025b8a9cc5e501413812d32e7", "3011371a48fdef061a8669b6636306b33cf2bf621e1960513c6ce70449f7cd3d", "310c95f1da5f92e937b136e55c2013e4bccd1b53bc88780256ba8ed75699dbdb", "359baeea2ca640e0dde31a03c3bf3d3008bcbd136c6b1768b58a3499a46a6cc2", "5202ac2d00226f0b2990af9f3301c1ba5eebb673ae0a0acfe499eaea8a1b23ad", "53fc0ad2e8d8f2f0c87bdc3009784de61f5dd9a4259f67301b317525eedc3ed5", "55355947c4fe4b37d2a51b8f1d3f36f7fca541cf012031225be836d1f743c011", "5691c630435fd6bd09a789de9ffd5a61b812445dfd515525c738a97d4f9b550a", "6739494376c90806cbb88e7ea2c9e2c35949e6c7089507d19e8f489170a26156", "a68232a60b8c1a822c4ac4096bfb42b4f873ac7dcef265642223690220b5af4f", "af664f067d3c905f4f44d724e65406ed95dd2b4adfcc3d23a9203320ce497950", "b9def7acd7c84ca86d0c3247e83180782c423d0e8a68254718fcc69e521570da", "bb96d5e0a82f67a04cde32f970ca837fbcf7ef44124170bc5e34f26c0ed92f7d", "c115744b2a0bf666fd8cde52a6d3e9319ffeb486009579743f5adfdcf0bf0773", "c642901f6c53b965785e57a597229dd87910991b3e2d8aecf552da7d48cfe170", "c9b47b2ee669b2f01824e0f3b364a8cdfab8d40df1b5987c7c2103d3e13ec9e9", "dd07976a2f2615d4f2ed3654b24e53fe837708602c00934ce1e963690c91c933", "e3b29248c9180fd6a30619b2714c534e3165e523a568296250337fe8952d39b8", "ed65392135299698b0ebff4ee53ccf19d5c7c12077652a7faab05db369eb3996", "f438eab30868997407b73814ba097b80862d6d5bc5f7f2fda384e60df769777b", "f73d6a3e711f26be58bfa13a65a425638fa9d3f4a081eebff0eb70e42fee40a8"] +aiohttp = ["00d198585474299c9c3b4f1d5de1a576cc230d562abc5e4a0e81d71a20a6ca55", "0155af66de8c21b8dba4992aaeeabf55503caefae00067a3b1139f86d0ec50ed", "09654a9eca62d1bd6d64aa44db2498f60a5c1e0ac4750953fdd79d5c88955e10", "199f1d106e2b44b6dacdf6f9245493c7d716b01d0b7fbe1959318ba4dc64d1f5", "296f30dedc9f4b9e7a301e5cc963012264112d78a1d3094cd83ef148fdf33ca1", "368ed312550bd663ce84dc4b032a962fcb3c7cae099dbbd48663afc305e3b939", "40d7ea570b88db017c51392349cf99b7aefaaddd19d2c78368aeb0bddde9d390", "629102a193162e37102c50713e2e31dc9a2fe7ac5e481da83e5bb3c0cee700aa", "6d5ec9b8948c3d957e75ea14d41e9330e1ac3fed24ec53766c780f82805140dc", "87331d1d6810214085a50749160196391a712a13336cd02ce1c3ea3d05bcf8d5", "9a02a04bbe581c8605ac423ba3a74999ec9d8bce7ae37977a3d38680f5780b6d", "9c4c83f4fa1938377da32bc2d59379025ceeee8e24b89f72fcbccd8ca22dc9bf", "9cddaff94c0135ee627213ac6ca6d05724bfe6e7a356e5e09ec57bd3249510f6", "a25237abf327530d9561ef751eef9511ab56fd9431023ca6f4803f1994104d72", "a5cbd7157b0e383738b8e29d6e556fde8726823dae0e348952a61742b21aeb12", "a97a516e02b726e089cffcde2eea0d3258450389bbac48cbe89e0f0b6e7b0366", "acc89b29b5f4e2332d65cd1b7d10c609a75b88ef8925d487a611ca788432dfa4", "b05bd85cc99b06740aad3629c2585bda7b83bd86e080b44ba47faf905fdf1300", "c2bec436a2b5dafe5eaeb297c03711074d46b6eb236d002c13c42f25c4a8ce9d", "cc619d974c8c11fe84527e4b5e1c07238799a8c29ea1c1285149170524ba9303", "d4392defd4648badaa42b3e101080ae3313e8f4787cb517efd3f5b8157eaefd6", "e1c3c582ee11af7f63a34a46f0448fca58e59889396ffdae1f482085061a2889"] appnope = ["5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0", "8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71"] argh = ["a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3", "e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65"] -"aspy.yaml" = ["04d26279513618f1024e1aba46471db870b3b33aef204c2d09bcf93bea9ba13f", "0a77e23fafe7b242068ffc0252cee130d3e509040908fc678d9d1060e7494baa"] +"aspy.yaml" = ["19dd2ee74f96b72a3096d78be1a872914c70982299cda137725478954870a896", "5eaaacd0886e8b581f0e4ff383fb6504720bb2b3c7be17307724246261a41adf"] astroid = ["35b032003d6a863f5dcd7ec11abd5cd5893428beaa31ab164982403bcb311f22", "6a5d668d7dc69110de01cdf7aeec69a679ef486862a0850cc0fd5571505b6b7e"] async-timeout = ["0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f", "4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3"] -atomicwrites = ["0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0", "ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee"] +atomicwrites = ["03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", "75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"] attrs = ["10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", "ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb"] backcall = ["38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4", "bbbf4b1e5cd2bdb08f915895b51081c041bac22394fdfcfdfbe9f14b77c08bf2"] cached-property = ["3a026f1a54135677e7da5ce819b0c690f156f37976f3e30c5430740725203d7f", "9217a59f14a5682da7c4b8829deadbfc194ac22e9908ccf7c8820234e80a1504"] certifi = ["47f9c83ef4c0c621eaef743f133f09fa8a74a9b75f037e8624f83bd1b6626cb7", "993f830721089fef441cdfeb4b2c8c9df86f0c63239f06bd025a76a7daddb033"] -cfgv = ["73f48a752bd7aab103c4b882d6596c6360b7aa63b34073dd2c35c7b4b8f93010", "d1791caa9ff5c0c7bce80e7ecc1921752a2eb7c2463a08ed9b6c96b85a2f75aa"] +cfgv = ["39d9055c47e3932908fe25abd5807e21dc002630db01c7a5f05738d027e2b706", "41d22dd864c474f919ecb88900000d2410d640315f75bdb79b3abf9347089641"] chardet = ["84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", "fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"] click = ["2335065e6395b9e67ca716de5f7526736bfa6ceead690adf616d925bdc622b13", "5b94b49521f6456670fdb30cd82a4eca9412788a93fa6dd6df72c94d5a8ff2d7"] colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] coverage = ["06123b58a1410873e22134ca2d88bd36680479fe354955b3579fb8ff150e4d27", "09e47c529ff77bf042ecfe858fb55c3e3eb97aac2c87f0349ab5a7efd6b3939f", "0a1f9b0eb3aa15c990c328535655847b3420231af299386cfe5efc98f9c250fe", "0cc941b37b8c2ececfed341444a456912e740ecf515d560de58b9a76562d966d", "0d34245f824cc3140150ab7848d08b7e2ba67ada959d77619c986f2062e1f0e8", "10e8af18d1315de936d67775d3a814cc81d0747a1a0312d84e27ae5610e313b0", "1b4276550b86caa60606bd3572b52769860a81a70754a54acc8ba789ce74d607", "1e8a2627c48266c7b813975335cfdea58c706fe36f607c97d9392e61502dc79d", "258b21c5cafb0c3768861a6df3ab0cfb4d8b495eee5ec660e16f928bf7385390", "2b224052bfd801beb7478b03e8a66f3f25ea56ea488922e98903914ac9ac930b", "3ad59c84c502cd134b0088ca9038d100e8fb5081bbd5ccca4863f3804d81f61d", "447c450a093766744ab53bf1e7063ec82866f27bcb4f4c907da25ad293bba7e3", "46101fc20c6f6568561cdd15a54018bb42980954b79aa46da8ae6f008066a30e", "4710dc676bb4b779c4361b54eb308bc84d64a2fa3d78e5f7228921eccce5d815", "510986f9a280cd05189b42eee2b69fecdf5bf9651d4cd315ea21d24a964a3c36", "5535dda5739257effef56e49a1c51c71f1d37a6e5607bb25a5eee507c59580d1", "5a7524042014642b39b1fcae85fb37556c200e64ec90824ae9ecf7b667ccfc14", "5f55028169ef85e1fa8e4b8b1b91c0b3b0fa3297c4fb22990d46ff01d22c2d6c", "6694d5573e7790a0e8d3d177d7a416ca5f5c150742ee703f3c18df76260de794", "6831e1ac20ac52634da606b658b0b2712d26984999c9d93f0c6e59fe62ca741b", "71afc1f5cd72ab97330126b566bbf4e8661aab7449f08895d21a5d08c6b051ff", "7349c27128334f787ae63ab49d90bf6d47c7288c63a0a5dfaa319d4b4541dd2c", "77f0d9fa5e10d03aa4528436e33423bfa3718b86c646615f04616294c935f840", "828ad813c7cdc2e71dcf141912c685bfe4b548c0e6d9540db6418b807c345ddd", "859714036274a75e6e57c7bab0c47a4602d2a8cfaaa33bbdb68c8359b2ed4f5c", "85a06c61598b14b015d4df233d249cd5abfa61084ef5b9f64a48e997fd829a82", "869ef4a19f6e4c6987e18b315721b8b971f7048e6eaea29c066854242b4e98d9", "8cb4febad0f0b26c6f62e1628f2053954ad2c555d67660f28dfb1b0496711952", "977e2d9a646773cc7428cdd9a34b069d6ee254fadfb4d09b3f430e95472f3cf3", "99bd767c49c775b79fdcd2eabff405f1063d9d959039c0bdd720527a7738748a", "a5c58664b23b248b16b96253880b2868fb34358911400a7ba39d7f6399935389", "aaa0f296e503cda4bc07566f592cd7a28779d433f3a23c48082af425d6d5a78f", "ab235d9fe64833f12d1334d29b558aacedfbca2356dfb9691f2d0d38a8a7bfb4", "b3b0c8f660fae65eac74fbf003f3103769b90012ae7a460863010539bb7a80da", "bab8e6d510d2ea0f1d14f12642e3f35cefa47a9b2e4c7cea1852b52bc9c49647", "c45297bbdbc8bb79b02cf41417d63352b70bcb76f1bbb1ee7d47b3e89e42f95d", "d19bca47c8a01b92640c614a9147b081a1974f69168ecd494687c827109e8f42", "d64b4340a0c488a9e79b66ec9f9d77d02b99b772c8b8afd46c1294c1d39ca478", "da969da069a82bbb5300b59161d8d7c8d423bc4ccd3b410a9b4d8932aeefc14b", "ed02c7539705696ecb7dc9d476d861f3904a8d2b7e894bd418994920935d36bb", "ee5b8abc35b549012e03a7b1e86c09491457dba6c94112a2482b18589cc2bdb9"] -dataclasses-json = ["3396123e9826a131286ee9aa8e598770b91a537ca3ec6f5049340c14bf6d9855", "9122d68a2738104f472a30246cb4be2b5bc36531010fa979b38c46258813d91e"] -decorator = ["2c51dff8ef3c447388fe5e4453d24a2bf128d3a4c32af3fabef1f01c6851ab82", "c39efa13fbdeb4506c476c9b3babf6a718da943dab7811c206005a4a956c080c"] +dataclasses-json = ["756aa719aa6d3df9909af829eb390f6a3b97a155994cc28184b0697b99b9f72c", "e8deb4f6cd81c5e15c5d82c4e3072ab9ce90c37ab5044bc1efb39520fea0f960"] +decorator = ["33cd704aea07b4c28b3eb2c97d288a06918275dac0ecebdaf1bc8a48d98adb9e", "cabb249f4710888a2fc0e13e9a16c343d932033718ff62e1e9bc93a9d3a9122b"] deepdiff = ["152b29dd9cd97cc78403121fb394925ec47377d4a410751e56547c3930ba2b39", "b4150052e610b231885c4c0be3eea86e4c029df91550ec51b9fc14dd209a5055", "ecad8e16a96ffd27e8f40c9801a6ab16ec6a7e7e6e6859a7710ba4695f22702c"] freezegun = ["6cb82b276f83f2acce67f121dc2656f4df26c71e32238334eb071170b892a278", "e839b43bfbe8158b4d62bb97e6313d39f3586daf48e1314fb1083d2ef17700da"] graphql-core-next = ["95509fc50cd632c5b004b959ffc397d47c709ba297162aa841839f610f1a6c70", "e40b5a6cb879fd269f4cfa0db267496273b575a6bfe487dfc46559fa46781c51"] -identify = ["08826e68e39e7de53cc2ddd8f6228a4e463b4bacb20565e5301c3ec690e68d27", "2364e24a7699fea0dc910e90740adbab43eef3746eeea4e016029c34123ce66d"] +identify = ["0749c74180ef0f6a3874eaa0bf89a6990a523233180e83e6f3c7c27312ac9ba3", "1cf14bc0324d83a742f558051db0c2cbe15d8b9ae1c59dfefbe38935f1d1ee31"] idna = ["c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", "ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"] importlib-metadata = ["a17ce1a8c7bff1e8674cb12c992375d8d0800c9190177ecf0ad93e0097224095", "b50191ead8c70adfa12495fba19ce6d75f2e0275c14c5a7beb653d6799b512bd"] inflection = ["18ea7fb7a7d152853386523def08736aa8c32636b047ade55f7578c4edeb16ca"] @@ -719,32 +719,32 @@ ipython-genutils = ["72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c6 isort = ["1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af", "b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8", "ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497"] jedi = ["571702b5bd167911fe9036e5039ba67f820d6502832285cde8c881ab2b2149fd", "c8481b5e59d34a5c7c42e98f6625e633f6ef59353abea6437472c7ec2093f191"] jinja2 = ["74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", "f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4"] -jsonpickle = ["8b6212f1155f43ce67fa945efae6d010ed059f3ca5ed377aa070e5903d45b722", "d43ede55b3d9b5524a8e11566ea0b11c9c8109116ef6a509a1b619d2041e7397", "ed4adf0d14564c56023862eabfac211cf01211a20c5271896c8ab6f80c68086c"] +jsonpickle = ["0231d6f7ebc4723169310141352d9c9b7bbbd6f3be110cf634575d2bf2af91f0", "625098cc8e5854b8c23b587aec33bc8e33e0e597636bfaca76152249c78fe5c1"] lazy-object-proxy = ["0ce34342b419bd8f018e6666bfef729aec3edf62345a53b537a4dcc115746a33", "1b668120716eb7ee21d8a38815e5eb3bb8211117d9a90b0f8e21722c0758cc39", "209615b0fe4624d79e50220ce3310ca1a9445fd8e6d3572a896e7f9146bbf019", "27bf62cb2b1a2068d443ff7097ee33393f8483b570b475db8ebf7e1cba64f088", "27ea6fd1c02dcc78172a82fc37fcc0992a94e4cecf53cb6d73f11749825bd98b", "2c1b21b44ac9beb0fc848d3993924147ba45c4ebc24be19825e57aabbe74a99e", "2df72ab12046a3496a92476020a1a0abf78b2a7db9ff4dc2036b8dd980203ae6", "320ffd3de9699d3892048baee45ebfbbf9388a7d65d832d7e580243ade426d2b", "50e3b9a464d5d08cc5227413db0d1c4707b6172e4d4d915c1c70e4de0bbff1f5", "5276db7ff62bb7b52f77f1f51ed58850e315154249aceb42e7f4c611f0f847ff", "61a6cf00dcb1a7f0c773ed4acc509cb636af2d6337a08f362413c76b2b47a8dd", "6ae6c4cb59f199d8827c5a07546b2ab7e85d262acaccaacd49b62f53f7c456f7", "7661d401d60d8bf15bb5da39e4dd72f5d764c5aff5a86ef52a042506e3e970ff", "7bd527f36a605c914efca5d3d014170b2cb184723e423d26b1fb2fd9108e264d", "7cb54db3535c8686ea12e9535eb087d32421184eacc6939ef15ef50f83a5e7e2", "7f3a2d740291f7f2c111d86a1c4851b70fb000a6c8883a59660d95ad57b9df35", "81304b7d8e9c824d058087dcb89144842c8e0dea6d281c031f59f0acf66963d4", "933947e8b4fbe617a51528b09851685138b49d511af0b6c0da2539115d6d4514", "94223d7f060301b3a8c09c9b3bc3294b56b2188e7d8179c762a1cda72c979252", "ab3ca49afcb47058393b0122428358d2fbe0408cf99f1b58b295cfeb4ed39109", "bd6292f565ca46dee4e737ebcc20742e3b5be2b01556dafe169f6c65d088875f", "cb924aa3e4a3fb644d0c463cad5bc2572649a6a3f68a7f8e4fbe44aaa6d77e4c", "d0fc7a286feac9077ec52a927fc9fe8fe2fabab95426722be4c953c9a8bede92", "ddc34786490a6e4ec0a855d401034cbd1242ef186c20d79d2166d6a4bd449577", "e34b155e36fa9da7e1b7c738ed7767fc9491a62ec6af70fe9da4a057759edc2d", "e5b9e8f6bda48460b7b143c3821b21b452cb3a835e6bbd5dd33aa0c8d3f5137d", "e81ebf6c5ee9684be8f2c87563880f93eedd56dd2b6146d8a725b50b7e5adb0f", "eb91be369f945f10d3a49f5f9be8b3d0b93a4c2be8f8a5b83b0571b8123e0a7a", "f460d1ceb0e4a5dcb2a652db0904224f367c9b3c1470d5a7683c0480e582468b"] markupsafe = ["048ef924c1623740e70204aa7143ec592504045ae4429b59c30054cb31e3c432", "130f844e7f5bdd8e9f3f42e7102ef1d49b2e6fdf0d7526df3f87281a532d8c8b", "19f637c2ac5ae9da8bfd98cef74d64b7e1bb8a63038a3505cd182c3fac5eb4d9", "1b8a7a87ad1b92bd887568ce54b23565f3fd7018c4180136e1cf412b405a47af", "1c25694ca680b6919de53a4bb3bdd0602beafc63ff001fea2f2fc16ec3a11834", "1f19ef5d3908110e1e891deefb5586aae1b49a7440db952454b4e281b41620cd", "1fa6058938190ebe8290e5cae6c351e14e7bb44505c4a7624555ce57fbbeba0d", "31cbb1359e8c25f9f48e156e59e2eaad51cd5242c05ed18a8de6dbe85184e4b7", "3e835d8841ae7863f64e40e19477f7eb398674da6a47f09871673742531e6f4b", "4e97332c9ce444b0c2c38dd22ddc61c743eb208d916e4265a2a3b575bdccb1d3", "525396ee324ee2da82919f2ee9c9e73b012f23e7640131dd1b53a90206a0f09c", "52b07fbc32032c21ad4ab060fec137b76eb804c4b9a1c7c7dc562549306afad2", "52ccb45e77a1085ec5461cde794e1aa037df79f473cbc69b974e73940655c8d7", "5c3fbebd7de20ce93103cb3183b47671f2885307df4a17a0ad56a1dd51273d36", "5e5851969aea17660e55f6a3be00037a25b96a9b44d2083651812c99d53b14d1", "5edfa27b2d3eefa2210fb2f5d539fbed81722b49f083b2c6566455eb7422fd7e", "7d263e5770efddf465a9e31b78362d84d015cc894ca2c131901a4445eaa61ee1", "83381342bfc22b3c8c06f2dd93a505413888694302de25add756254beee8449c", "857eebb2c1dc60e4219ec8e98dfa19553dae33608237e107db9c6078b1167856", "98e439297f78fca3a6169fd330fbe88d78b3bb72f967ad9961bcac0d7fdd1550", "bf54103892a83c64db58125b3f2a43df6d2cb2d28889f14c78519394feb41492", "d9ac82be533394d341b41d78aca7ed0e0f4ba5a2231602e2f05aa87f25c51672", "e982fe07ede9fada6ff6705af70514a52beb1b2c3d25d4e873e82114cf3c5401", "edce2ea7f3dfc981c4ddc97add8a61381d9642dc3273737e756517cc03e84dd6", "efdc45ef1afc238db84cb4963aa689c0408912a0239b0721cb172b4016eb31d6", "f137c02498f8b935892d5c0172560d7ab54bc45039de8805075e19079c639a9c", "f82e347a72f955b7017a39708a3667f106e6ad4d10b25f237396a7115d8ed5fd", "fb7c206e01ad85ce57feeaaa0bf784b97fa3cad0d4a5737bc5295785f5c613a1"] -marshmallow = ["7adba78acbce1a812185ab8139d2c80223387d751f8c558d53eceb8aecf7cae5", "9aa50624253e654ae97a22854e37287042911c15fb23932be357e56df33c2d51"] +marshmallow = ["313836a251e67d2ef06631f3bddfffdd7d1c5b16b4efc76244afa6218c5e17b0", "c850c60dbb840860f58f161b81ae25cf84807eeae3f9a1d9a2f8c704d6bd2b80"] mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"] more-itertools = ["38a936c0a6d98a38bcc2d03fdaaedaba9f412879461dd2ceff8d37564d6522e4", "c0a5785b1109a6bd7fac76d6837fd1feca158e54e521ccd2ae8bfe393cc9d4fc", "fe7a7cae1ccb57d33952113ff4fa1bc5f879963600ed74918f1236e212ee50b9"] multidict = ["024b8129695a952ebd93373e45b5d341dbb87c17ce49637b34000093f243dd4f", "041e9442b11409be5e4fc8b6a97e4bcead758ab1e11768d1e69160bdde18acc3", "045b4dd0e5f6121e6f314d81759abd2c257db4634260abcfe0d3f7083c4908ef", "047c0a04e382ef8bd74b0de01407e8d8632d7d1b4db6f2561106af812a68741b", "068167c2d7bbeebd359665ac4fff756be5ffac9cda02375b5c5a7c4777038e73", "148ff60e0fffa2f5fad2eb25aae7bef23d8f3b8bdaf947a65cdbe84a978092bc", "1d1c77013a259971a72ddaa83b9f42c80a93ff12df6a4723be99d858fa30bee3", "1d48bc124a6b7a55006d97917f695effa9725d05abe8ee78fd60d6588b8344cd", "31dfa2fc323097f8ad7acd41aa38d7c614dd1960ac6681745b6da124093dc351", "34f82db7f80c49f38b032c5abb605c458bac997a6c3142e0d6c130be6fb2b941", "3d5dd8e5998fb4ace04789d1d008e2bb532de501218519d70bb672c4c5a2fc5d", "4a6ae52bd3ee41ee0f3acf4c60ceb3f44e0e3bc52ab7da1c2b2aa6703363a3d1", "4b02a3b2a2f01d0490dd39321c74273fed0568568ea0e7ea23e02bd1fb10a10b", "4b843f8e1dd6a3195679d9838eb4670222e8b8d01bc36c9894d6c3538316fa0a", "5de53a28f40ef3c4fd57aeab6b590c2c663de87a5af76136ced519923d3efbb3", "61b2b33ede821b94fa99ce0b09c9ece049c7067a33b279f343adfe35108a4ea7", "6a3a9b0f45fd75dc05d8e93dc21b18fc1670135ec9544d1ad4acbcf6b86781d0", "76ad8e4c69dadbb31bad17c16baee61c0d1a4a73bed2590b741b2e1a46d3edd0", "7ba19b777dc00194d1b473180d4ca89a054dd18de27d0ee2e42a103ec9b7d014", "7c1b7eab7a49aa96f3db1f716f0113a8a2e93c7375dd3d5d21c4941f1405c9c5", "7fc0eee3046041387cbace9314926aa48b681202f8897f8bff3809967a049036", "8ccd1c5fff1aa1427100ce188557fc31f1e0a383ad8ec42c559aabd4ff08802d", "8e08dd76de80539d613654915a2f5196dbccc67448df291e69a88712ea21e24a", "c18498c50c59263841862ea0501da9f2b3659c00db54abfbf823a80787fde8ce", "c49db89d602c24928e68c0d510f4fcf8989d77defd01c973d6cbe27e684833b1", "ce20044d0317649ddbb4e54dab3c1bcc7483c78c27d3f58ab3d0c7e6bc60d26a", "d1071414dd06ca2eafa90c85a079169bfeb0e5f57fd0b45d44c092546fcd6fd9", "d3be11ac43ab1a3e979dac80843b42226d5d3cccd3986f2e03152720a4297cd7", "db603a1c235d110c860d5f39988ebc8218ee028f07a7cbc056ba6424372ca31b"] nodeenv = ["ad8259494cf1c9034539f6cced78a1da4840a4b157e23640bc4a0c0546b0cb7a"] -parso = ["35704a43a3c113cce4de228ddb39aab374b8004f4f2407d070b6a2ca784ce8a2", "895c63e93b94ac1e1690f5fdd40b65f07c8171e3e53cbd7793b5b96c0e0a7f24"] +parso = ["6ecf7244be8e7283ec9009c72d074830e7e0e611c974f813d76db0390a4e0dd6", "8162be7570ffb34ec0b8d215d7f3b6c5fab24f51eb3886d6dee362de96b6db94"] pathtools = ["7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0"] pexpect = ["2a8e88259839571d1251d278476f3eec5db26deb73a70be5ed5dc5435e418aba", "3fbd41d4caf27fa4a377bfd16fef87271099463e6fa73e92a52f92dfee5d425b"] pickleshare = ["87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca", "9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"] -pluggy = ["447ba94990e8014ee25ec853339faf7b0fc8050cdc3289d4d71f7f410fb90095", "bde19360a8ec4dfd8a20dcb811780a30998101f078fc7ded6162f0076f50508f"] +pluggy = ["8ddc32f03971bfdf900a81961a48ccf2fb677cf7715108f85295c67405798616", "980710797ff6a041e9a73a5787804f848996ecaa6f8a1b1e08224a5894f2074a"] pre-commit = ["33bb9bf599c334d458fa9e311bde54e0c306a651473b6a36fdb36a61c8605c89", "e233f5cf3230ae9ed9ada132e9cf6890e18cc937adc669353fb64394f6e80c17"] -prompt-toolkit = ["c1d6aff5252ab2ef391c2fe498ed8c088066f66bc64a8d5c095bbf795d9fec34", "d4c47f79b635a0e70b84fdb97ebd9a274203706b1ee5ed44c10da62755cf3ec9", "fd17048d8335c1e6d5ee403c3569953ba3eb8555d710bfc548faf0712666ea39"] +prompt-toolkit = ["88002cc618cacfda8760c4539e76c3b3f148ecdb7035a3d422c7ecdc90c2a3ba", "c6655a12e9b08edb8cf5aeab4815fd1e1bdea4ad73d3bbf269cf2e0c4eb75d5e", "df5835fb8f417aa55e5cafadbaeb0cf630a1e824aad16989f9f0493e679ec010"] ptyprocess = ["923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0", "d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f"] py = ["bf92637198836372b520efcba9e020c330123be8ce527e535d185ed4b6f45694", "e76826342cefe3c3d5f7e8ee4316b80d1dd8a300781612ddbc765c17ba25a6c6"] pygments = ["5ffada19f6203563680669ee7f53b64dabbeb100eb51b61996085e99c03b284a", "e8218dd399a61674745138520d0d4cf2621d7e032439341bc3f647bff125818d"] pylint = ["689de29ae747642ab230c6d37be2b969bf75663176658851f456619aacf27492", "771467c434d0d9f081741fec1d64dfb011ed26e65e12a28fe06ca2f61c4d556c"] -pytest = ["f689bf2fc18c4585403348dd56f47d87780bf217c53ed9ae7a3e2d7faa45f8e9", "f812ea39a0153566be53d88f8de94839db1e8a05352ed8a49525d7d7f37861e9"] -pytest-cov = ["513c425e931a0344944f84ea47f3956be0e416d95acbd897a44970c8d926d5d7", "e360f048b7dae3f2f2a9a4d067b2dd6b6a015d384d1577c994a43f3f7cbad762"] -pytest-describe = ["bd6be131452b7822c872735ffe53ce3931b3b80cbbad1647c2b482cc9ef3d00e"] +pytest = ["65aeaa77ae87c7fc95de56285282546cfa9c886dc8e5dc78313db1c25e21bc07", "6ac6d467d9f053e95aaacd79f831dbecfe730f419c6c7022cb316b365cd9199d"] +pytest-cov = ["0ab664b25c6aa9716cbf203b17ddb301932383046082c081b9848a0edf5add33", "230ef817450ab0699c6cc3c9c8f7a829c34674456f2ed8df1fe1d39780f7c87f"] +pytest-describe = ["569bda96401fe512f4f345f33fd23fa4d718639d42afac62bc03254b5f2b3fdf"] pytest-expecter = ["1c8e9ab98ddd576436b61a7ba61ea11cfa5a3fc6b00288ce9e91e9dd770daf19", "27c93dfe87e2f4d28c525031be68d3f89457e3315241d97ee15f7689544e0e37"] -pytest-mock = ["53801e621223d34724926a5c98bd90e8e417ce35264365d39d6c896388dcc928", "d89a8209d722b8307b5e351496830d5cc5e192336003a485443ae9adeb7dd4c0"] +pytest-mock = ["4d0d06d173eecf172703219a71dbd4ade0e13904e6bbce1ce660e2e0dc78b5c4", "bfdf02789e3d197bd682a758cae0a4a18706566395fbe2803badcd1335e0173e"] pytest-random = ["92f25db8c5d9ffc20d90b51997b914372d6955cb9cf1f6ead45b90514fc0eddd"] -python-dateutil = ["063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93", "88f9287c0174266bb0d8cedd395cfba9c58e87e5ad86b2ce58859bc11be3cf02"] +python-dateutil = ["7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"] pyyaml = ["3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b", "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf", "40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a", "558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3", "a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1", "aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1", "bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613", "d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04", "d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f", "e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537", "e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531"] requests = ["502a824f31acdacb3a35b6690b5fbf0bc41d63a24a45c4004352b0242707598e", "7bf2a778576d825600030a110f3c0e3e8edc51dfaafe1c146e39a2027784957b"] six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"] @@ -752,9 +752,9 @@ toml = ["229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "235 traitlets = ["9c4bd2d267b7153df9152698efb1050a5d84982d3384a37b2c1f7723ba3e7835", "c6cb5e6f57c5a9bdaa40fa71ce7b4af30298fbab9ece9815b5d995ab6217c7d9"] urllib3 = ["61bf29cada3fc2fbefad4fdf059ea4bd1b4a86d2b6d15e1c7c0b582b9752fe39", "de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"] verchew = ["6f1a5ac6e0c5ff1f2a762694d19568bc2533c26a1e0a4eacff73dcb248d6031d", "b5ba7022176f3ecfe8e0ddb6f28bd61916d20e7b3fa58a05bca11c1589db2301"] -virtualenv = ["34b9ae3742abed2f95d3970acf4d80533261d6061b51160b197f84e5b4c98b4c"] +virtualenv = ["58c359370401e0af817fb0070911e599c5fdc836166306b04fd0f278151ed125", "729f0bcab430e4ef137646805b5b1d8efbb43fe53d4a0f33328624a84a5121f7"] watchdog = ["965f658d0732de3188211932aeb0bb457587f04f63ab4c1e33eab878e9de961d"] wcwidth = ["3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", "f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"] -wrapt = ["d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6"] +wrapt = ["4aea003270831cceb8a90ff27c4031da6ead7ec1886023b80ce0dfe0adf61533"] yarl = ["024ecdc12bc02b321bc66b41327f930d1c2c543fa9a561b39861da9388ba7aa9", "2f3010703295fbe1aec51023740871e64bb9664c789cba5a6bdf404e93f7568f", "3890ab952d508523ef4881457c4099056546593fa05e93da84c7250516e632eb", "3e2724eb9af5dc41648e5bb304fcf4891adc33258c6e14e2a7414ea32541e320", "5badb97dd0abf26623a9982cd448ff12cb39b8e4c94032ccdedf22ce01a64842", "73f447d11b530d860ca1e6b582f947688286ad16ca42256413083d13f260b7a0", "7ab825726f2940c16d92aaec7d204cfc34ac26c0040da727cf8ba87255a33829", "b25de84a8c20540531526dfbb0e2d2b648c13fd5dd126728c496d7c3fea33310", "c6e341f5a6562af74ba55205dbd56d248daf1b5748ec48a0200ba227bb9e33f4", "c9bb7c249c4432cd47e75af3864bc02d26c9594f49c82e2a28624417f0ae63b8", "e060906c0c585565c718d1c3841747b61c5439af2211e185f6739a9412dfbde1"] zipp = ["55ca87266c38af6658b84db8cfb7343cdb0bf275f93c7afaea0d8e7a209c7478", "682b3e1c62b7026afe24eadf6be579fb45fec54c07ea218bded8092af07a68c4"] From 56f55b824ef77da9a4b5c5e1828799bde780fa99 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 14:33:06 -0800 Subject: [PATCH 27/35] pylint needs to import codec to work --- examples/simple/.pylintrc | 425 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 425 insertions(+) create mode 100644 examples/simple/.pylintrc diff --git a/examples/simple/.pylintrc b/examples/simple/.pylintrc new file mode 100644 index 0000000..b031323 --- /dev/null +++ b/examples/simple/.pylintrc @@ -0,0 +1,425 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist=ujson + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +init-hook="import gql.codec.fast_register" + +# Use multiple processes to speed up Pylint. +jobs=1 + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +load-plugins= + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable=fixme,too-few-public-methods,duplicate-code,bare-except,wrong-import-order,missing-docstring,line-too-long,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[BASIC] + +# Naming hint for argument names +argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct argument names +argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for attribute names +attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct attribute names +attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming hint for function names +function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct function names +function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for method names +method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct method names +method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming hint for variable names +variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^\s*(# )??$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=140 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules= + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=15 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception From 402bf3299901b4f9ef217472aa40a026b3edc9c0 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 14:47:49 -0800 Subject: [PATCH 28/35] nicer code --- examples/simple/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/simple/client.py b/examples/simple/client.py index 2f4b9a8..c58b890 100755 --- a/examples/simple/client.py +++ b/examples/simple/client.py @@ -1,14 +1,14 @@ # coding: gql -MY_QUERY = gql""" -query hello_query { +QUERY = gql""" +query HelloQuery { hello(argument: "World") } """ def main(): - result = MY_QUERY.execute() + result = QUERY.execute() print(result) if __name__ == "__main__": - main() \ No newline at end of file + main() From fddcff276f9409cb53be2cd038e57b70e5108cb5 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 14:48:04 -0800 Subject: [PATCH 29/35] ending newline --- gql/codec/transform.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gql/codec/transform.py b/gql/codec/transform.py index b70c921..bdf9f80 100644 --- a/gql/codec/transform.py +++ b/gql/codec/transform.py @@ -1,3 +1,4 @@ +import os from io import BytesIO from tokenize import tokenize, TokenInfo, NL, NEWLINE, ENCODING, NAME, OP, STRING @@ -84,7 +85,7 @@ def gql_transform(stream: BytesIO): query_started = False result = untokenize(transformed_tokens) - return result.rstrip() + return result.rstrip() + os.linesep def gql_transform_string(value: str): From db3afb290506018a212373d4f99df31162ab2d9d Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 14:48:13 -0800 Subject: [PATCH 30/35] lint bootstrap.py --- examples/simple/bootstrap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/simple/bootstrap.py b/examples/simple/bootstrap.py index 8e4e939..bbf7f3e 100644 --- a/examples/simple/bootstrap.py +++ b/examples/simple/bootstrap.py @@ -1,4 +1,4 @@ -import gql.codec.fast_register +import gql.codec.fast_register # pylint:disable=unused-import import client -client.main() \ No newline at end of file +client.main() From 6787a8651787ae896b3230d5b5d5933a45a843c7 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 17:53:27 -0800 Subject: [PATCH 31/35] Wrap autogenerated code with comments --- gql/renderer_dataclasses.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gql/renderer_dataclasses.py b/gql/renderer_dataclasses.py index 2233d05..d3eda16 100644 --- a/gql/renderer_dataclasses.py +++ b/gql/renderer_dataclasses.py @@ -16,6 +16,8 @@ def render(self, parsed_query: ParsedQuery): # We sort fragment nodes to be first and operations to be last because of dependecies buffer = CodeChunk() + buffer.write('# AUTOGENERATED file. Do not Change!') + self.__render_header(buffer) if self.internal_ns: @@ -45,6 +47,7 @@ def render(self, parsed_query: ParsedQuery): if self.internal_ns: buffer.unindent() + buffer.write('# AUTOGENERATED EOF') return str(buffer) @staticmethod @@ -56,7 +59,6 @@ def get_operation_class_name(parsed_query: ParsedQuery): raise Exception('No operation defined') def __render_header(self, buffer: CodeChunk): - buffer.write('# AUTOGENERATED file. Do not Change!') buffer.write('from functools import partial') buffer.write('from typing import Optional, Any, Callable, Mapping, List') buffer.write('from enum import Enum') @@ -95,6 +97,7 @@ def __render_object(self, parsed_query: ParsedQuery, buffer: CodeChunk, obj: Par buffer.write('@dataclass_json') buffer.write('@dataclass') with buffer.write_block(f'class {obj.name}{class_parents}:'): + # render child objects for child_object in obj.children: self.__render_object(parsed_query, buffer, child_object) From c342f0415924f65825f3d13bd35993264f149c48 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 17:53:34 -0800 Subject: [PATCH 32/35] lint --- examples/simple/server.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/simple/server.py b/examples/simple/server.py index 0eacc7c..7a62c33 100644 --- a/examples/simple/server.py +++ b/examples/simple/server.py @@ -3,13 +3,14 @@ from flask import Flask class Query(graphene.ObjectType): + # pylint:disable=no-self-use hello = graphene.String(argument=graphene.String(default_value="stranger")) - def resolve_hello(self, info, argument): + def resolve_hello(self, _, argument): return 'Hello ' + argument -schema = graphene.Schema(query=Query) +SCHEMA = graphene.Schema(query=Query) -app = Flask(__name__) -app.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=schema, graphiql=True)) \ No newline at end of file +APP = Flask(__name__) +APP.add_url_rule('/graphql', view_func=GraphQLView.as_view('graphql', schema=SCHEMA, graphiql=True)) From c29268c06fca6efdb32c751937896be4db24630c Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Wed, 6 Feb 2019 17:54:43 -0800 Subject: [PATCH 33/35] Decode works --- examples/simple/client.py | 2 ++ gql/codec/register.py | 18 ++++++------------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/examples/simple/client.py b/examples/simple/client.py index c58b890..4edda74 100755 --- a/examples/simple/client.py +++ b/examples/simple/client.py @@ -1,10 +1,12 @@ # coding: gql +# pylint:disable=no-member,unused-import QUERY = gql""" query HelloQuery { hello(argument: "World") } """ +# pylint:enable=no-member,unused-import def main(): result = QUERY.execute() diff --git a/gql/codec/register.py b/gql/codec/register.py index c00425b..a1534b7 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import os import sys import codecs import encodings @@ -7,19 +8,9 @@ from gql.codec.transform import gql_transform -DEFAULT_RESULT = None - def gql_decode(value, **_): - if isinstance(value, memoryview): - value = value.tobytes().decode("utf-8") - - # strip the gql coding line from code so that the python tokenizer can read the code - value = '# coding: utf-8\n' + value - - bio = BytesIO(value.encode('utf-8')) - result = gql_transform(bio) - return result, len(result) + return utf_8.decode(value) class GQLIncrementalDecoder(utf_8.IncrementalDecoder): @@ -28,9 +19,12 @@ def decode(self, input: bytes, final: bool = False): # pylint:disable=redefined if final: buff = self.buffer self.buffer = '' + buff = buff.decode('utf-8') + buff = buff.replace('# coding: gql', '') + buff = buff.encode('utf-8') return gql_transform(BytesIO(buff)) - return DEFAULT_RESULT + return None class GQLStreamReader(utf_8.StreamReader): From eeacb5179245cc471c31d4a2f16348c22ed8e5c2 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 7 Feb 2019 11:41:27 -0800 Subject: [PATCH 34/35] fixing gql_decode --- examples/simple/client.py | 4 +++- gql/codec/register.py | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/examples/simple/client.py b/examples/simple/client.py index 4edda74..da5b69b 100755 --- a/examples/simple/client.py +++ b/examples/simple/client.py @@ -3,14 +3,16 @@ # pylint:disable=no-member,unused-import QUERY = gql""" query HelloQuery { - hello(argument: "World") + helloo(argument: "World") } """ # pylint:enable=no-member,unused-import + def main(): result = QUERY.execute() print(result) + print(result.data.hello) if __name__ == "__main__": main() diff --git a/gql/codec/register.py b/gql/codec/register.py index a1534b7..6bff12e 100755 --- a/gql/codec/register.py +++ b/gql/codec/register.py @@ -7,10 +7,20 @@ from io import BytesIO from gql.codec.transform import gql_transform +from gql.query_parser import InvalidQueryError def gql_decode(value, **_): - return utf_8.decode(value) + decoded, decoded_length = utf_8.decode(value) + decoded = decoded.replace('# coding: gql', '') + try: + bio = BytesIO(decoded.encode('utf-8')) + result = gql_transform(bio) + return result, decoded_length + except InvalidQueryError: + raise + except Exception as ex: + return decoded, decoded_length class GQLIncrementalDecoder(utf_8.IncrementalDecoder): @@ -22,7 +32,8 @@ def decode(self, input: bytes, final: bool = False): # pylint:disable=redefined buff = buff.decode('utf-8') buff = buff.replace('# coding: gql', '') buff = buff.encode('utf-8') - return gql_transform(BytesIO(buff)) + result = gql_transform(BytesIO(buff)) + return result return None From 5885b9a27e564c80dd4655dd68e50c74f44f6341 Mon Sep 17 00:00:00 2001 From: Eran Kampf Date: Thu, 7 Feb 2019 11:43:58 -0800 Subject: [PATCH 35/35] Fixed example --- examples/simple/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/simple/client.py b/examples/simple/client.py index da5b69b..dcd96b4 100755 --- a/examples/simple/client.py +++ b/examples/simple/client.py @@ -3,7 +3,7 @@ # pylint:disable=no-member,unused-import QUERY = gql""" query HelloQuery { - helloo(argument: "World") + hello(argument: "World") } """ # pylint:enable=no-member,unused-import