diff --git a/CHANGELOG.md b/CHANGELOG.md index ed5981f..c857c08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +1.0.5 + +- Upgrade base lib with bug fixing +- Update docs + 1.0.4 - Upgrade base lib with bug fixing diff --git a/README.md b/README.md index 2e2cd21..3d8d7d6 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,21 @@ # Axtiva Flexible Graphql Bundle -Symfony bundle for Flexible Graphql PHP +Symfony bundle for [Flexible Graphql PHP](https://github.com/axtiva/flexible-graphql-php) for fast implementation graphql api + +## Features - SDL first code generation - Fast integration to any project without breaking changes - Lazy loading on schema definition +- Apollo Federation Support +- Executable directives - Support symfony native opcache preload file generation # Setup Composer install: -``` +```shell composer require axtiva/flexible-graphql-bundle ``` @@ -28,26 +32,24 @@ flexible_graphql: default_resolver: flexible_graphql.default_resolver # default resolver if it does not defined ``` -Generate models and type registry: +Run command ```shell -bin/console flexible_graphql:generate-type-registry +bin/console cache:clear ``` -Generate Directive resolver for executable directives: +Look at flexible_graphql.dir created files. -```shell -bin/console flexible_graphql:generate-directive-resolver directive_name -``` +## Quick install -Generate Field Resolver: +Quick install [guide](docs/index.md) -```shell -bin/console flexible_graphql:generate-field-resolver type_name field_name -``` +## Example integration -Generate Scalar Resolver: +Look at example project [axtiva/example-integration/FlexibleGraphqlBundle](https://github.com/axtiva/example-integration/tree/master/FlexibleGraphqlBundle) + +## Supported commands ```shell -bin/console flexible_graphql:generate-scalar-resolver scalar_name -``` \ No newline at end of file +bin/console list flexible_graphql +``` diff --git a/composer.json b/composer.json index 279f2a3..e6d985c 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ }, "require": { "php": "^7.4 | ^8.0", - "axtiva/flexible-graphql-php": "^1.0.3", - "axtiva/flexible-graphql-federation": "^0.3.3", + "axtiva/flexible-graphql-php": "^1.1", + "axtiva/flexible-graphql-federation": "^1.0", "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/docs/index.md b/docs/index.md index d3a5368..b94c55a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -8,7 +8,7 @@ Open example project [axtiva/example-integration/FlexibleGraphqlBundle](https:// ## Composer install in your Symfony app -``` +```shell composer require axtiva/flexible-graphql-bundle ``` @@ -27,10 +27,17 @@ flexible_graphql: default_resolver: flexible_graphql.default_resolver # default resolver if it does not defined ``` -## Run type registry code generation +## Define container as service +```yaml +services: + Psr\Container\ContainerInterface: '@service_container' ``` -bin/console flexible_graphql:generate-type-registry + +## Run code generation with warmup command + +```shell +bin/console cache:clear ``` ## Create GraphQL Controller @@ -71,7 +78,9 @@ class GraphqlController extends AbstractController $this->httpFactory = $httpFactory; } - #[Route('/graphql', name: 'graphql')] + /** + * @Route("/graphql", name="graphql") + */ public function index(Request $request): Response { $typeRegistry = $this->typeRegistry; @@ -107,3 +116,5 @@ class GraphqlController extends AbstractController } } ``` + +And start querying data by route `/graphql` \ No newline at end of file diff --git a/src/Command/GenerateDirectiveResolverCommand.php b/src/Command/GenerateDirectiveResolverCommand.php index a78d1dd..0e2e7f9 100644 --- a/src/Command/GenerateDirectiveResolverCommand.php +++ b/src/Command/GenerateDirectiveResolverCommand.php @@ -35,7 +35,7 @@ public function __construct( protected function configure() { $this - ->setDescription('generate directive resolver') + ->setDescription('generate executive directive resolver') ->addArgument('directive_name', InputArgument::REQUIRED, 'name of directive in sdl schema') ; } diff --git a/src/Command/GenerateScalarResolverCommand.php b/src/Command/GenerateScalarResolverCommand.php index ff6cf85..f7f9c0e 100644 --- a/src/Command/GenerateScalarResolverCommand.php +++ b/src/Command/GenerateScalarResolverCommand.php @@ -35,7 +35,7 @@ public function __construct( protected function configure() { $this - ->setDescription('generate scalar resolver') + ->setDescription('generate custom scalar resolver') ->addArgument('custom_scalar_name', InputArgument::REQUIRED, 'name of custom scalar in sdl schema') ; } diff --git a/src/Command/GenerateTypeRegistryCommand.php b/src/Command/GenerateTypeRegistryCommand.php index bf54fde..2ed76ba 100644 --- a/src/Command/GenerateTypeRegistryCommand.php +++ b/src/Command/GenerateTypeRegistryCommand.php @@ -37,7 +37,7 @@ public function __construct( protected function configure() { $this - ->setDescription('generate type registry') + ->setDescription('generate type registry class for lazy load schema') ; }