Skip to content

Commit 8b52961

Browse files
authored
Merge branch 'master' into patch-3
2 parents d269442 + 04818f2 commit 8b52961

File tree

16 files changed

+104
-25
lines changed

16 files changed

+104
-25
lines changed

docs/annotations/index.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,27 @@ In the previous example, the generated `resolve` config of the `something` field
116116

117117
## Type & Args auto-guessing
118118

119+
### @Field type auto-guessing when defined on a property with a type hint
120+
121+
The type of the `@Field` annotation can be auto-guessed if it's defined on a property with a type hint.
122+
If the property has a usable type hint this is used and no futher guessing is done.
123+
124+
For example:
125+
126+
```php
127+
/**
128+
* @GQL\Type
129+
*/
130+
class MyType {
131+
/**
132+
* @GQL\Field
133+
*/
134+
protected string $property;
135+
}
136+
```
137+
138+
In this example, the type `String!` will be auto-guessed from the type hint of the property.
139+
119140
### @Field type auto-guessing from Doctrine ORM Annotations
120141

121142
Based on other Doctrine annotations on your fields, the corresponding GraphQL type can sometimes be guessed automatically.

src/Annotation/Access.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class Access implements Annotation
1515
/**
1616
* Field access.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/

src/Annotation/Arg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class Arg implements Annotation
1515
/**
1616
* Argument name.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/
@@ -31,7 +31,7 @@ final class Arg implements Annotation
3131
/**
3232
* Argument type.
3333
*
34-
* @required
34+
* @Required
3535
*
3636
* @var string
3737
*/

src/Annotation/Deprecated.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class Deprecated implements Annotation
1515
/**
1616
* The deprecation reason.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/

src/Annotation/Description.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class Description implements Annotation
1515
/**
1616
* The object description.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/

src/Annotation/Field.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class Field implements Annotation
2222
/**
2323
* Field Type.
2424
*
25-
* @required
26-
*
2725
* @var string
2826
*/
2927
public string $type;

src/Annotation/FieldsBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class FieldsBuilder implements Annotation
1515
/**
1616
* Builder name.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/

src/Annotation/IsPublic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ final class IsPublic implements Annotation
1515
/**
1616
* Field publicity.
1717
*
18-
* @required
18+
* @Required
1919
*
2020
* @var string
2121
*/

src/Annotation/Relay/Edge.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final class Edge extends Type
1717
/**
1818
* Edge Node type.
1919
*
20-
* @required
20+
* @Required
2121
*
2222
* @var string
2323
*/

src/Annotation/TypeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ final class TypeInterface implements Annotation
2222
/**
2323
* Resolver type for interface.
2424
*
25-
* @required
25+
* @Required
2626
*
2727
* @var string
2828
*/

0 commit comments

Comments
 (0)