diff --git a/Command/DumpSchemaCommand.php b/Command/DumpSchemaCommand.php index a3521dc..d1330b9 100644 --- a/Command/DumpSchemaCommand.php +++ b/Command/DumpSchemaCommand.php @@ -43,7 +43,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int { $io = new SymfonyStyle($input, $output); - $schemaExport = SchemaPrinterForGraphQLite::doPrint($this->schema, ['sortTypes' => true]); + $schemaExport = SchemaPrinterForGraphQLite::doPrint($this->schema, ['sortTypes' => true, 'sortFields' => true]); $filename = $input->getOption('output'); if (\is_string($filename)) { diff --git a/Tests/Command/DumpSchemaCommandTest.php b/Tests/Command/DumpSchemaCommandTest.php index 6fa5160..e99fc48 100644 --- a/Tests/Command/DumpSchemaCommandTest.php +++ b/Tests/Command/DumpSchemaCommandTest.php @@ -19,7 +19,7 @@ public function testExecute(): void $commandTester->execute([]); self::assertMatchesRegularExpression( - '/type Product {[\s"]*seller: Contact\s*name: String!\s*price: Float!\s*}/', + '/type Product {[\s"]*name: String!\s*price: Float!\s*seller: Contact\s*}/', $commandTester->getDisplay() ); }