You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/annotations/annotations-reference.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -241,7 +241,7 @@ Optional attributes:
241
241
Deprecated attributes:
242
242
-**values** : An array of `@EnumValue`to define description or deprecated reason of enum values
243
243
244
-
The class will also be used by the `Arguments Transformer` service when an `Enum` is encoutered in a Mutation or Query Input. A property accessor will try to populate a property name `value`.
244
+
The class will also be used by the `Arguments Transformer` service when an `Enum` is encountered in a Mutation or Query Input. A property accessor will try to populate a property name `value`.
245
245
246
246
Example:
247
247
@@ -266,7 +266,7 @@ class Planet
266
266
```
267
267
268
268
In the example above, if a query or mutation has this Enum as an argument, the value will be an instance of the class with the enum value as the `value` property. (see [The Arguments Transformer documentation](arguments-transformer.md)).
269
-
As the class can be instanciated from the `Arguments Transformer` service, it cannot have a constructor with required arguments.
269
+
As the class can be instantiated from the `Arguments Transformer` service, it cannot have a constructor with required arguments.
270
270
271
271
## @EnumValue
272
272
@@ -427,7 +427,7 @@ The corresponding class will also be used by the `Arguments Transformer` service
427
427
428
428
## @IsPublic
429
429
430
-
Added on a _class_ in conjunction with `@Type` or `@TypeInterface`, this annotation will define the defaut to set if fields are public or not.
430
+
Added on a _class_ in conjunction with `@Type` or `@TypeInterface`, this annotation will define the default to set if fields are public or not.
431
431
Added on a _property_ or _method_ in conjunction with `@Field`, it'll define an expression to set if the field is public or not.
432
432
433
433
Example:
@@ -646,7 +646,7 @@ This annotation is used on a _class_ to define an union.
646
646
647
647
Required attributes:
648
648
649
-
-**types** : An array of GraphQL Type as string (can be auto-guessed. See union documenation).
649
+
-**types** : An array of GraphQL Type as string (can be auto-guessed. See union documentation).
Copy file name to clipboardExpand all lines: docs/annotations/arguments-transformer.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# The Arguments Transformer service
2
2
3
3
When using annotation, as we use classes to describe our GraphQL objects, it is also possible to create and populate classes instances using GraphQL data.
4
-
If a class is used to describe a GraphQL Input, this same class can be instanciated to hold the corresponding GraphQL Input data.
5
-
This is where the `Arguments Transformer` comes into play. Knowing the matching between GraphQL types and PHP classes, the service is able to instanciate a PHP classes and populate it with data based on the corresponding GraphQL type.
4
+
If a class is used to describe a GraphQL Input, this same class can be instantiated to hold the corresponding GraphQL Input data.
5
+
This is where the `Arguments Transformer` comes into play. Knowing the matching between GraphQL types and PHP classes, the service is able to instantiate a PHP classes and populate it with data based on the corresponding GraphQL type.
6
6
To invoke the Arguments Transformer, we use the `input` expression function in our resolvers.
7
7
8
8
## the `arguments` function in expression language
Copy file name to clipboardExpand all lines: docs/definitions/resolver.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,8 +15,8 @@ Resolvers can be defined in 2 different ways:
15
15
You can declare a resolver (any class that implements `Overblog\GraphQLBundle\Definition\Resolver\QueryInterface` or `Overblog\GraphQLBundle\Definition\Resolver\MutationInterface`) in `src/*Bundle/GraphQL` or `app/GraphQL` and they will be auto discovered.
16
16
Auto map classes method are accessible by:
17
17
* double-colon (::) to separate service id (class name) and the method names
* for callable classes you can use the service id (example: `AppBunble\GraphQL\InvokeResolver` for a resolver implementing the `__invoke` method) you can also alias a type by implementing `Overblog\GraphQLBundle\Definition\Resolver\AliasedInterface` which returns a map of method/alias. The service created will autowire the `__construct` and `Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer` methods.
* for callable classes you can use the service id (example: `AppBundle\GraphQL\InvokeResolver` for a resolver implementing the `__invoke` method) you can also alias a type by implementing `Overblog\GraphQLBundle\Definition\Resolver\AliasedInterface` which returns a map of method/alias. The service created will autowire the `__construct` and `Symfony\Component\DependencyInjection\ContainerAwareInterface::setContainer` methods.
20
20
21
21
**Note:**
22
22
* When using service id as FQCN in yaml or annotation definition, backslashes must be correctly escaped, here an example:
0 commit comments