diff --git a/ariadne_graphql_proxy/proxy_schema.py b/ariadne_graphql_proxy/proxy_schema.py index 2647cfb..3560253 100644 --- a/ariadne_graphql_proxy/proxy_schema.py +++ b/ariadne_graphql_proxy/proxy_schema.py @@ -234,9 +234,11 @@ async def root_resolver( { "operationName": operation_name, "query": print_ast(query_document), - "variables": variables - if not variables - else {key: variables[key] for key in query_variables}, + "variables": ( + variables + if not variables + else {key: variables[key] for key in query_variables} + ), }, ) for schema_id, query_document, query_variables in queries diff --git a/pyproject.toml b/pyproject.toml index 76b6cde..e0b2fd6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ dependencies = ["graphql-core>=3.2.0,<3.3", "httpx", "ariadne"] test = [ "black", "freezegun", - "moto", + "moto[dynamodb]", "mypy", "pytest", "pytest-mock", diff --git a/tests/contrib/aws/test_cache_backend.py b/tests/contrib/aws/test_cache_backend.py index 6046c7e..e6c82de 100644 --- a/tests/contrib/aws/test_cache_backend.py +++ b/tests/contrib/aws/test_cache_backend.py @@ -5,7 +5,7 @@ import boto3 import pytest from freezegun import freeze_time -from moto import mock_dynamodb +from moto import mock_aws from ariadne_graphql_proxy.cache import CacheSerializer from ariadne_graphql_proxy.contrib.aws import DynamoDBCacheBackend, DynamoDBCacheError @@ -23,7 +23,7 @@ def aws_credentials(): @pytest.fixture def test_table(aws_credentials): - with mock_dynamodb(): + with mock_aws(): table = boto3.resource("dynamodb").create_table( TableName="test_table", KeySchema=[{"AttributeName": "key", "KeyType": "HASH"}], @@ -38,7 +38,7 @@ def test_object_can_be_created_with_existing_table_name(test_table): DynamoDBCacheBackend(table_name="test_table") -@mock_dynamodb +@mock_aws def test_init_raises_dynamodb_cache_error_for_unavailable_table(aws_credentials): with pytest.raises(DynamoDBCacheError): DynamoDBCacheBackend(table_name="not_exisitng_table_name")