diff --git a/graphene_django/settings.py b/graphene_django/settings.py index 7cd750a..e5fad78 100644 --- a/graphene_django/settings.py +++ b/graphene_django/settings.py @@ -28,7 +28,7 @@ except ImportError: DEFAULTS = { "SCHEMA": None, "SCHEMA_OUTPUT": "schema.json", - "SCHEMA_INDENT": None, + "SCHEMA_INDENT": 2, "MIDDLEWARE": (), # Set to True if the connection fields must have # either the first or last argument diff --git a/graphene_django/tests/test_command.py b/graphene_django/tests/test_command.py index 2ed4ce0..fa78aec 100644 --- a/graphene_django/tests/test_command.py +++ b/graphene_django/tests/test_command.py @@ -11,7 +11,7 @@ def test_generate_file_on_call_graphql_schema(savefile_mock, settings): @patch('json.dump') -def test_files_are_sorted(dump_mock): +def test_files_are_canonical(dump_mock): open_mock = mock_open() with patch('graphene_django.management.commands.graphql_schema.open', open_mock): management.call_command('graphql_schema', schema='') @@ -20,3 +20,4 @@ def test_files_are_sorted(dump_mock): dump_mock.assert_called_once() assert dump_mock.call_args[1]["sort_keys"], "json.mock() should be used to sort the output" + assert dump_mock.call_args[1]["indent"] > 0, "output should be pretty-printed by default"