Skip to content

Commit e5911d2

Browse files
authored
Merge pull request #90 from thecodingmachine/moufmouf-patch-1
Update Symfony doc to use Flex recipe
2 parents 8286290 + f46806a commit e5911d2

File tree

2 files changed

+88
-8
lines changed

2 files changed

+88
-8
lines changed

docs/symfony-bundle.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,33 @@ sidebar_label: Symfony bundle
66

77
The GraphQLite bundle is compatible with **Symfony 4.x** and **Symfony 5.x**.
88

9-
<div class="alert alert-warning">
10-
The Symfony Flex recipe is not yet available.
11-
</div>
9+
## Applications that use Symfony Flex
10+
11+
Open a command console, enter your project directory and execute:
12+
13+
```console
14+
$ composer require thecodingmachine/graphqlite-bundle
15+
```
1216

13-
## Installation
17+
Now, go to the `config/packages/graphqlite.yaml` file and edit the namespaces to match your application.
18+
19+
**config/packages/graphqlite.yaml**
20+
```yaml
21+
graphqlite:
22+
namespace:
23+
# The namespace(s) that will store your GraphQLite controllers.
24+
# It accept either a string or a list of strings.
25+
controllers: App\GraphQLController\
26+
# The namespace(s) that will store your GraphQL types and factories.
27+
# It accept either a string or a list of strings.
28+
types:
29+
- App\Types\
30+
- App\Entity\
31+
```
32+
33+
More advanced parameters are detailed in the ["advanced configuration" section](#advanced-configuration)
34+
35+
## Applications that don't use Symfony Flex
1436
1537
Open a terminal in your current project directory and run:
1638
@@ -59,6 +81,24 @@ graphqlite:
5981
types:
6082
- App\Types\
6183
- App\Entity\
84+
```
85+
86+
## Advanced configuration
87+
88+
### Customizing error handling
89+
90+
You can add a "debug" section in the `graphqlite.yaml` file to customize the way errors are handled.
91+
By default, GraphQLite configures the underlying Webonyx GraphQL library this way:
92+
93+
- All exceptions that implement the `ClientAware` interface are caught by GraphQLite
94+
- All other exceptions will bubble up and by caught by Symfony error handling mechanism
95+
96+
We found out those settings to be quite convenient but you can override those to your preference.
97+
98+
**config/packages/graphqlite.yaml**
99+
```yaml
100+
graphqlite:
101+
# ...
62102
debug:
63103
# Include exception messages in output when an error arises.
64104
INCLUDE_DEBUG_MESSAGE: false

website/versioned_docs/version-4.0/symfony-bundle.md

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,33 @@ original_id: symfony-bundle
77

88
The GraphQLite bundle is compatible with **Symfony 4.x** and **Symfony 5.x**.
99

10-
<div class="alert alert-warning">
11-
The Symfony Flex recipe is not yet available.
12-
</div>
10+
## Applications that use Symfony Flex
11+
12+
Open a command console, enter your project directory and execute:
13+
14+
```console
15+
$ composer require thecodingmachine/graphqlite-bundle
16+
```
1317

14-
## Installation
18+
Now, go to the `config/packages/graphqlite.yaml` file and edit the namespaces to match your application.
19+
20+
**config/packages/graphqlite.yaml**
21+
```yaml
22+
graphqlite:
23+
namespace:
24+
# The namespace(s) that will store your GraphQLite controllers.
25+
# It accept either a string or a list of strings.
26+
controllers: App\GraphQLController\
27+
# The namespace(s) that will store your GraphQL types and factories.
28+
# It accept either a string or a list of strings.
29+
types:
30+
- App\Types\
31+
- App\Entity\
32+
```
33+
34+
More advanced parameters are detailed in the ["advanced configuration" section](#advanced-configuration)
35+
36+
## Applications that don't use Symfony Flex
1537
1638
Open a terminal in your current project directory and run:
1739
@@ -60,6 +82,24 @@ graphqlite:
6082
types:
6183
- App\Types\
6284
- App\Entity\
85+
```
86+
87+
## Advanced configuration
88+
89+
### Customizing error handling
90+
91+
You can add a "debug" section in the `graphqlite.yaml` file to customize the way errors are handled.
92+
By default, GraphQLite configures the underlying Webonyx GraphQL library this way:
93+
94+
- All exceptions that implement the `ClientAware` interface are caught by GraphQLite
95+
- All other exceptions will bubble up and by caught by Symfony error handling mechanism
96+
97+
We found out those settings to be quite convenient but you can override those to your preference.
98+
99+
**config/packages/graphqlite.yaml**
100+
```yaml
101+
graphqlite:
102+
# ...
63103
debug:
64104
# Include exception messages in output when an error arises.
65105
INCLUDE_DEBUG_MESSAGE: false

0 commit comments

Comments
 (0)