Skip to content

Commit c6f7149

Browse files
authored
Merge pull request #225 from andrea-sal/order-type-fields-in-dump-schema-command
Orders type fields in the dump schema command using the sortFields flag.
2 parents f02ce0f + aab7b4c commit c6f7149

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Command/DumpSchemaCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4343
{
4444
$io = new SymfonyStyle($input, $output);
4545

46-
$schemaExport = SchemaPrinterForGraphQLite::doPrint($this->schema, ['sortTypes' => true]);
46+
$schemaExport = SchemaPrinterForGraphQLite::doPrint($this->schema, ['sortTypes' => true, 'sortFields' => true]);
4747

4848
$filename = $input->getOption('output');
4949
if (\is_string($filename)) {

Tests/Command/DumpSchemaCommandTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function testExecute(): void
1919
$commandTester->execute([]);
2020

2121
self::assertMatchesRegularExpression(
22-
'/type Product {[\s"]*seller: Contact\s*name: String!\s*price: Float!\s*}/',
22+
'/type Product {[\s"]*name: String!\s*price: Float!\s*seller: Contact\s*}/',
2323
$commandTester->getDisplay()
2424
);
2525
}

0 commit comments

Comments
 (0)