@@ -6,11 +6,33 @@ sidebar_label: Symfony bundle
6
6
7
7
The GraphQLite bundle is compatible with ** Symfony 4.x** and ** Symfony 5.x** .
8
8
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
+ ```
12
16
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
14
36
15
37
Open a terminal in your current project directory and run:
16
38
@@ -59,6 +81,24 @@ graphqlite:
59
81
types:
60
82
- App\T ypes\
61
83
- App\E ntity\
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
+ # ...
62
102
debug:
63
103
# Include exception messages in output when an error arises.
64
104
INCLUDE_DEBUG_MESSAGE: false
0 commit comments