From 0e832f9e719cb2a92379249d5d4ba99a3db9a202 Mon Sep 17 00:00:00 2001 From: bpteam Date: Wed, 6 Apr 2022 09:23:19 +0300 Subject: [PATCH] fix generator commands for iterable generators --- CHANGELOG.md | 5 +++++ composer.json | 4 ++-- src/Command/GenerateDirectiveResolverCommand.php | 6 ++++-- src/Command/GenerateFieldResolverCommand.php | 5 +++-- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be00f4a..ed5981f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +1.0.4 + +- Upgrade base lib with bug fixing +- Fix generator commands for iterable generators + 1.0.3 - Upgrade base lib with bug fixing diff --git a/composer.json b/composer.json index 555b208..279f2a3 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ }, "require": { "php": "^7.4 | ^8.0", - "axtiva/flexible-graphql-php": "^1.0.2", - "axtiva/flexible-graphql-federation": "^0.3.2", + "axtiva/flexible-graphql-php": "^1.0.3", + "axtiva/flexible-graphql-federation": "^0.3.3", "axtiva/graphql-federation-extension": "^1.0.1", "symfony/config": "^4.4 | ^5.0 | ^6.0", "symfony/dependency-injection": "^4.4 | ^5.0 | ^6.0", diff --git a/src/Command/GenerateDirectiveResolverCommand.php b/src/Command/GenerateDirectiveResolverCommand.php index 6a07e08..a78d1dd 100644 --- a/src/Command/GenerateDirectiveResolverCommand.php +++ b/src/Command/GenerateDirectiveResolverCommand.php @@ -56,9 +56,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int $io->error('Directive did not found in schema ' . $directiveName); return Command::FAILURE; } - $code = $codeGenerator->generateDirectiveResolver($directive, $schema); + $io->success('Directive resolver generated'); - $io->writeln($code->getFilename()); + foreach($codeGenerator->generateDirectiveResolver($directive, $schema) as $code) { + $io->writeln($code->getFilename()); + } return Command::SUCCESS; } diff --git a/src/Command/GenerateFieldResolverCommand.php b/src/Command/GenerateFieldResolverCommand.php index 9288135..8b46940 100644 --- a/src/Command/GenerateFieldResolverCommand.php +++ b/src/Command/GenerateFieldResolverCommand.php @@ -63,9 +63,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int return Command::FAILURE; } - $code = $codeGenerator->generateFieldResolver($type, $field, $schema); $io->success('Field resolver generated'); - $io->writeln($code->getFilename()); + foreach ($codeGenerator->generateFieldResolver($type, $field, $schema) as $code) { + $io->writeln($code->getFilename()); + } return Command::SUCCESS; }