lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

python3Packages.graphene-django: unstable-2021-06-11 -> unstable-2022-03-03

+157 -3
+7 -3
pkgs/development/python-modules/graphene-django/default.nix
··· 19 19 20 20 buildPythonPackage rec { 21 21 pname = "graphene-django"; 22 - version = "unstable-2021-06-11"; 22 + version = "unstable-2022-03-03"; 23 23 format = "setuptools"; 24 24 disabled = pythonOlder "3.6"; 25 25 26 26 src = fetchFromGitHub { 27 27 owner = "graphql-python"; 28 28 repo = pname; 29 - rev = "e7f7d8da07ba1020f9916153f17e97b0ec037712"; 30 - sha256 = "0b33q1im90ahp3gzy9wx5amfzy6q57ydjpy5rn988gh81hbyqaxv"; 29 + rev = "f6ec0689c18929344c79ae363d2e3d5628fa4a2d"; 30 + hash = "sha256-KTZ5jcoeHYXnlaF47t8jIi6+7NyMyA4hDPv+il3bt+U="; 31 31 }; 32 + 33 + patches = [ 34 + ./graphene-3_2_0.patch 35 + ]; 32 36 33 37 postPatch = '' 34 38 substituteInPlace setup.py \
+150
pkgs/development/python-modules/graphene-django/graphene-3_2_0.patch
··· 1 + diff --git a/graphene_django/filter/tests/test_fields.py b/graphene_django/filter/tests/test_fields.py 2 + index 7d440f4..0aec6e4 100644 3 + --- a/graphene_django/filter/tests/test_fields.py 4 + +++ b/graphene_django/filter/tests/test_fields.py 5 + @@ -1005,7 +1005,7 @@ def test_integer_field_filter_type(): 6 + 7 + schema = Schema(query=Query) 8 + 9 + - assert str(schema) == dedent( 10 + + assert str(schema).rstrip() + "\n" == dedent( 11 + """\ 12 + type Query { 13 + pets(offset: Int = null, before: String = null, after: String = null, first: Int = null, last: Int = null, age: Int = null): PetTypeConnection 14 + @@ -1074,7 +1074,7 @@ def test_other_filter_types(): 15 + 16 + schema = Schema(query=Query) 17 + 18 + - assert str(schema) == dedent( 19 + + assert str(schema).rstrip() + "\n" == dedent( 20 + """\ 21 + type Query { 22 + pets(offset: Int = null, before: String = null, after: String = null, first: Int = null, last: Int = null, age: Int = null, age_Isnull: Boolean = null, age_Lt: Int = null): PetTypeConnection 23 + diff --git a/graphene_django/tests/test_command.py b/graphene_django/tests/test_command.py 24 + index 70116b8..a4ab4db 100644 25 + --- a/graphene_django/tests/test_command.py 26 + +++ b/graphene_django/tests/test_command.py 27 + @@ -49,7 +49,7 @@ def test_generate_graphql_file_on_call_graphql_schema(): 28 + assert handle.write.called_once() 29 + 30 + schema_output = handle.write.call_args[0][0] 31 + - assert schema_output == dedent( 32 + + assert schema_output.rstrip() + "\n" == dedent( 33 + """\ 34 + type Query { 35 + hi: String 36 + diff --git a/graphene_django/tests/test_types.py b/graphene_django/tests/test_types.py 37 + index bde72c7..0b64440 100644 38 + --- a/graphene_django/tests/test_types.py 39 + +++ b/graphene_django/tests/test_types.py 40 + @@ -247,7 +247,7 @@ def test_schema_representation(): 41 + } 42 + """ 43 + ) 44 + - assert str(schema) == expected 45 + + assert str(schema).rstrip() + "\n" == expected 46 + 47 + 48 + def with_local_registry(func): 49 + @@ -515,7 +515,7 @@ class TestDjangoObjectType: 50 + 51 + schema = Schema(query=Query) 52 + 53 + - assert str(schema) == dedent( 54 + + assert str(schema).rstrip() + "\n" == dedent( 55 + """\ 56 + type Query { 57 + pet: Pet 58 + @@ -541,7 +541,7 @@ class TestDjangoObjectType: 59 + 60 + schema = Schema(query=Query) 61 + 62 + - assert str(schema) == dedent( 63 + + assert str(schema).rstrip() + "\n" == dedent( 64 + """\ 65 + type Query { 66 + pet: Pet 67 + @@ -576,7 +576,7 @@ class TestDjangoObjectType: 68 + 69 + schema = Schema(query=Query) 70 + 71 + - assert str(schema) == dedent( 72 + + assert str(schema).rstrip() + "\n" == dedent( 73 + """\ 74 + type Query { 75 + pet: Pet 76 + @@ -603,7 +603,7 @@ class TestDjangoObjectType: 77 + 78 + schema = Schema(query=Query) 79 + 80 + - assert str(schema) == dedent( 81 + + assert str(schema).rstrip() + "\n" == dedent( 82 + """\ 83 + type Query { 84 + pet: PetModelKind 85 + @@ -642,7 +642,7 @@ class TestDjangoObjectType: 86 + 87 + schema = Schema(query=Query) 88 + 89 + - assert str(schema) == dedent( 90 + + assert str(schema).rstrip() + "\n" == dedent( 91 + """\ 92 + type Query { 93 + pet: PetModelKind 94 + diff --git a/graphene_django/tests/test_views.py b/graphene_django/tests/test_views.py 95 + index 945fa87..e2e8b46 100644 96 + --- a/graphene_django/tests/test_views.py 97 + +++ b/graphene_django/tests/test_views.py 98 + @@ -109,12 +109,10 @@ def test_reports_validation_errors(client): 99 + { 100 + "message": "Cannot query field 'unknownOne' on type 'QueryRoot'.", 101 + "locations": [{"line": 1, "column": 9}], 102 + - "path": None, 103 + }, 104 + { 105 + "message": "Cannot query field 'unknownTwo' on type 'QueryRoot'.", 106 + "locations": [{"line": 1, "column": 21}], 107 + - "path": None, 108 + }, 109 + ] 110 + } 111 + @@ -135,8 +133,6 @@ def test_errors_when_missing_operation_name(client): 112 + "errors": [ 113 + { 114 + "message": "Must provide operation name if query contains multiple operations.", 115 + - "locations": None, 116 + - "path": None, 117 + } 118 + ] 119 + } 120 + @@ -476,8 +472,7 @@ def test_handles_syntax_errors_caught_by_graphql(client): 121 + "errors": [ 122 + { 123 + "locations": [{"column": 1, "line": 1}], 124 + - "message": "Syntax Error: Unexpected Name 'syntaxerror'.", 125 + - "path": None, 126 + + "message": "Syntax Error: Unexpected Name 'syntaxerror'." 127 + } 128 + ] 129 + } 130 + diff --git a/graphene_django/views.py b/graphene_django/views.py 131 + index c23b020..f533f70 100644 132 + --- a/graphene_django/views.py 133 + +++ b/graphene_django/views.py 134 + @@ -11,7 +11,6 @@ from django.views.decorators.csrf import ensure_csrf_cookie 135 + from django.views.generic import View 136 + from graphql import OperationType, get_operation_ast, parse, validate 137 + from graphql.error import GraphQLError 138 + -from graphql.error import format_error as format_graphql_error 139 + from graphql.execution import ExecutionResult 140 + 141 + from graphene import Schema 142 + @@ -387,7 +386,7 @@ class GraphQLView(View): 143 + @staticmethod 144 + def format_error(error): 145 + if isinstance(error, GraphQLError): 146 + - return format_graphql_error(error) 147 + + return error.formatted 148 + 149 + return {"message": str(error)} 150 +