-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from moufmouf/adding_symfony_specific_doc
Adding Symfony specific doc page
- Loading branch information
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
id: symfony-bundle-advanced | ||
title: Symfony bundle: advanced usage | ||
sidebar_label: Symfony specific features | ||
--- | ||
|
||
The Symfony bundle comes with a number of features to ease the integration of GraphQLite in Symfony. | ||
|
||
|
||
## Injecting the Request | ||
|
||
You can inject the Symfony Request object in any query/mutation/field. | ||
|
||
Most of the time, getting the request object is irrelevant. Indeed, it is GraphQLite's job to parse this request and | ||
manage it for you. Sometimes yet, fetching the request can be needed. In those cases, simply type-hint on the request | ||
in any parameter of your query/mutation/field. | ||
|
||
```php | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
/** | ||
* @Query | ||
*/ | ||
public function getUser(int $id, Request $request): User | ||
{ | ||
// The $request object contains the Symfony Request. | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters