Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Fix reviews remarks

fowczareka07c0c9c59a6
diff --git a/saleor/graphql/management/commands/get_graphql_schema.py b/saleor/graphql/management/commands/get_graphql_schema.py
index 695018acdd..6e5812f4ae 100644
--- a/saleor/graphql/management/commands/get_graphql_schema.py
+++ b/saleor/graphql/management/commands/get_graphql_schema.py
@@ -8,10 +8,14 @@ class Command(BaseCommand):
help = "Writes SDL for GraphQL API schema to stdout"
def handle(self, *args, **options):
+ """Support multiple interface notation in schema for Apollo tooling.
+
+ In `graphql-core` V2 separator for interaces is `,`.
+ Apollo tooling to generate TypeScript types using `&` as interfaces separator.
+ https://github.com/graphql-python/graphql-core/pull/258
+ """
printed_schema = print_schema(schema)
- schema_lines = printed_schema.splitlines()
- for index, line in enumerate(schema_lines):
+ for line in printed_schema.splitlines():
if "implements" in line:
- schema_lines[index] = line.replace(",", " &")
- printed_schema = "\n".join(schema_lines)
- self.stdout.write(printed_schema)
+ line = line.replace(",", " &")
+ self.stdout.write(f"{line}\n")