Skip to content

Commit 02c4b1b

Browse files
committed
Update Symfony doc to use Flex recipe
Now that the Flex recipe has been accepted, we can change the documentation accordingly.
1 parent 8286290 commit 02c4b1b

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

docs/symfony-bundle.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,34 @@ The GraphQLite bundle is compatible with **Symfony 4.x** and **Symfony 5.x**.
1010
The Symfony Flex recipe is not yet available.
1111
</div>
1212

13-
## Installation
13+
14+
## Applications that use Symfony Flex
15+
16+
Open a command console, enter your project directory and execute:
17+
18+
```console
19+
$ composer require thecodingmachine/graphqlite-bundle
20+
```
21+
22+
Now, go to the `config/packages/graphqlite.yaml` file and edit the namespaces to match your application.
23+
24+
**config/packages/graphqlite.yaml**
25+
```yaml
26+
graphqlite:
27+
namespace:
28+
# The namespace(s) that will store your GraphQLite controllers.
29+
# It accept either a string or a list of strings.
30+
controllers: App\Controller\
31+
# The namespace(s) that will store your GraphQL types and factories.
32+
# It accept either a string or a list of strings.
33+
types:
34+
- App\Types\
35+
- App\Entity\
36+
```
37+
38+
More advanced parameters are detailed in the ["advanced configuration" section](#advanced-configuration)
39+
40+
## Applications that don't use Symfony Flex
1441
1542
Open a terminal in your current project directory and run:
1643
@@ -59,6 +86,24 @@ graphqlite:
5986
types:
6087
- App\Types\
6188
- App\Entity\
89+
```
90+
91+
## Advanced configuration
92+
93+
### Customizing error handling
94+
95+
You can add a "debug" section in the `graphqlite.yaml` file to customize the way errors are handled.
96+
By default, GraphQLite configures the underlying Webonyx GraphQL library this way:
97+
98+
- All exceptions that implement the `ClientAware` interface are caught by GraphQLite
99+
- All other exceptions will bubble up and by caught by Symfony error handling mechanism
100+
101+
We found out those settings to be quite convenient but you can override those to your preference.
102+
103+
**config/packages/graphqlite.yaml**
104+
```yaml
105+
graphqlite:
106+
# ...
62107
debug:
63108
# Include exception messages in output when an error arises.
64109
INCLUDE_DEBUG_MESSAGE: false

0 commit comments

Comments
 (0)