Skip to content

Commit

Permalink
Merge pull request overblog#531 from overblog/murtukov-patch-2
Browse files Browse the repository at this point in the history
Update annotations-reference.md
  • Loading branch information
murtukov authored Jul 18, 2019
2 parents 5acda18 + cbc1ef4 commit 46506c1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/annotations/annotations-reference.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Annotations reference

In the following reference examples, the `use Overblog\GraphQLBundle\Annotation as GQL;` will is omitted.
In the following reference examples the line `use Overblog\GraphQLBundle\Annotation as GQL;` will be omitted.

## Notes

- When a annotation require an expression, the `@=` will be added automatically if it is not set.
- When an annotation requires an expression, the `@=` will be added automatically if it's not set.

- For example, `@GQL\Access("isAuthenticated()")` will be converted to `['access' => '@=isAuthenticated()']`.
- For example, `@GQL\Access("isAuthenticated()")` will be converted to `['access' => '@=isAuthenticated()']` during the compilation.

- You can use multiple type annotations on the same class. For example, if you need your class to be a Graphql Type AND a Graphql Input, you just need to add the two annotations. Incompatible annotations or properties for a specified Type will simply be ignored.
- You can use multiple type annotations on the same class. For example, if you need your class to be a GraphQL Type AND a Graphql Input, you just need to add the two annotations. Incompatible annotations or properties for a specified Type will simply be ignored.

In the following example, both the type `Coordinates` and the input type `CoordinatesInput` will be generated.
As fields on input type don't support resolvers, the field `elevation` will simply be ignored to generate the input type (it will only have two fields: `latitude` and `longitude`).
In the following example, both the type `Coordinates` and the input type `CoordinatesInput` will be generated during the compilation process.
As fields on input types don't support resolvers, the field `elevation` will simply be ignored to generate the input type (it will only have two fields: `latitude` and `longitude`).

```php
<?php
Expand All @@ -36,7 +36,6 @@ class Coordinates {
*/
public $elevation;
}
>
```

## Index
Expand Down

0 comments on commit 46506c1

Please sign in to comment.