From 9fc9bbe60115896f43ba43926aafc984eff76ef9 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Sun, 23 Feb 2020 09:26:00 +0000 Subject: [PATCH] Add some documentation --- docs/introspection.rst | 14 ++++++++++++++ .../management/commands/graphql_schema.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/introspection.rst b/docs/introspection.rst index dea55bd..2097c30 100644 --- a/docs/introspection.rst +++ b/docs/introspection.rst @@ -29,6 +29,20 @@ you're ready to use Relay with Graphene GraphQL implementation. The schema file is sorted to create a reproducible canonical representation. +GraphQL SDL Representation +-------------------------- + +The schema can also be exported as a GraphQL SDL file by changing the file +extension : + +.. code:: bash + + ./manage.py graphql_schema --schema tutorial.quickstart.schema --out schema.graphql + +When exporting the schema as a ``.graphql`` file the ``--indent`` option is +ignored. + + Advanced Usage -------------- diff --git a/graphene_django/management/commands/graphql_schema.py b/graphene_django/management/commands/graphql_schema.py index 490c773..751a385 100644 --- a/graphene_django/management/commands/graphql_schema.py +++ b/graphene_django/management/commands/graphql_schema.py @@ -46,7 +46,7 @@ class CommandArguments(BaseCommand): class Command(CommandArguments): - help = "Dump Graphene schema JSON or graphql to file" + help = "Dump Graphene schema as a JSON or GraphQL file" can_import_settings = True def save_json_file(self, out, schema_dict, indent):