Skip to content

Commit 0e12343

Browse files
leonardoarroyoleonardo arroyo
and
leonardo arroyo
authored
Fix issue #1055 (#1056)
* Fix issue #1055 * Fix if to elif * Use self.stdout.write instead of print when printing graphql schema Co-authored-by: leonardo arroyo <[[email protected]](mailto:[email protected])>
1 parent cc3bd05 commit 0e12343

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

graphene_django/management/commands/graphql_schema.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ def save_graphql_file(self, out, schema):
6060

6161
def get_schema(self, schema, out, indent):
6262
schema_dict = {"data": schema.introspect()}
63-
if out == "-":
63+
if out == "-" or out == "-.json":
6464
self.stdout.write(json.dumps(schema_dict, indent=indent, sort_keys=True))
65+
elif out == "-.graphql":
66+
self.stdout.write(print_schema(schema))
6567
else:
6668
# Determine format
6769
_, file_extension = os.path.splitext(out)

0 commit comments

Comments
 (0)