Skip to content

Commit f46806a

Browse files
committed
Updating versionned doc
1 parent e015812 commit f46806a

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

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)