Skip to content

Commit

Permalink
update readme and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
bpteam committed Jul 2, 2022
1 parent 0e832f9 commit 80c3bff
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 24 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.0.5

- Upgrade base lib with bug fixing
- Update docs

1.0.4

- Upgrade base lib with bug fixing
Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
```

Expand All @@ -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
```
bin/console list flexible_graphql
```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
19 changes: 15 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand All @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -107,3 +116,5 @@ class GraphqlController extends AbstractController
}
}
```

And start querying data by route `/graphql`
2 changes: 1 addition & 1 deletion src/Command/GenerateDirectiveResolverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GenerateScalarResolverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Command/GenerateTypeRegistryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
protected function configure()
{
$this
->setDescription('generate type registry')
->setDescription('generate type registry class for lazy load schema')
;
}

Expand Down

0 comments on commit 80c3bff

Please sign in to comment.