Commit 5812837
committed
Clarify type syntax #9954
`API\Field` and `API\Input` must always specify a FQCN if referencing
models. Otherwise, `ecodev/graphql-doctrine` is not able to find the
corresponding GraphQL type. So from `'User'`, it cannot guess we really
mean `'Application\Model\User'`.
The easiest solution is to use `::class` notation as much as possible,
even for non-models:
```diff
- #[API\Field(type: 'Group')]
+ #[API\Field(type: Group::class)]
```
```diff
- #[API\Input(type: 'Login')]
+ #[API\Input(type: LoginType::class)]
```
And keep string literals only when we must specify a nullable or list
type, such as:
```php
#[API\Field(type: '?Login')]
```
or
```php
#[API\Input(type: '?TagID[]')]
```1 parent 5acf016 commit 5812837
File tree
6 files changed
+27
-24
lines changed- src/Attribute
6 files changed
+27
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
212 | 217 | | |
213 | 218 | | |
214 | 219 | | |
215 | 220 | | |
216 | | - | |
217 | | - | |
| 221 | + | |
218 | 222 | | |
219 | 223 | | |
220 | 224 | | |
| |||
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
296 | | - | |
297 | 300 | | |
298 | 301 | | |
299 | 302 | | |
| |||
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | | - | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
472 | 475 | | |
473 | 476 | | |
474 | 477 | | |
| 478 | + | |
475 | 479 | | |
476 | 480 | | |
477 | 481 | | |
478 | 482 | | |
479 | | - | |
480 | | - | |
| 483 | + | |
| 484 | + | |
481 | 485 | | |
482 | 486 | | |
483 | 487 | | |
| |||
513 | 517 | | |
514 | 518 | | |
515 | 519 | | |
516 | | - | |
517 | 520 | | |
518 | 521 | | |
519 | 522 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
0 commit comments