Skip to content

Commit

Permalink
Merge pull request #111 from moufmouf/adding_symfony_specific_doc
Browse files Browse the repository at this point in the history
Adding Symfony specific doc page
  • Loading branch information
moufmouf authored Jul 12, 2019
2 parents 35fb733 + 224d70d commit 3cc98d3
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 1 deletion.
28 changes: 28 additions & 0 deletions docs/symfony-bundle-advanced.md
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.
}
```
3 changes: 3 additions & 0 deletions docs/symfony-bundle.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,6 @@ graphqlite:

The debug parameters are detailed in the [documentation of the Webonyx GraphQL library](https://webonyx.github.io/graphql-php/error-handling/)
which is used internally by GraphQLite.

The Symfony bundle come with a set of advanced features that are not described in this install documentation.
Jump to the ["Symfony specific features"](symfony-bundle-advanced.md) documentation of GraphQLite if you want to learn more.
2 changes: 1 addition & 1 deletion website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Installation": ["getting-started", "symfony-bundle", "laravel-package", "universal_service_providers", "other-frameworks"],
"Usage": ["queries", "mutations", "type_mapping", "autowiring", "extend_type", "authentication_authorization", "external_type_declaration", "input-types", "inheritance"],
"Performance": ["query-plan", "prefetch-method"],
"Advanced": ["file-uploads", "pagination", "custom-types", "field-middlewares", "extend_input_type", "multiple_output_types", "internals", "troubleshooting", "migrating"],
"Advanced": ["file-uploads", "pagination", "custom-types", "field-middlewares", "extend_input_type", "multiple_output_types", "symfony-bundle-advanced", "internals", "troubleshooting", "migrating"],
"Reference": ["annotations_reference"]
}
}

0 comments on commit 3cc98d3

Please sign in to comment.