Commit 97b518d
committed
Fix: Pass builtInOnly parameter correctly for list types
When processing ListOfType in mapGraphQLTypeToPHPType, the $builtInOnly
parameter was incorrectly passed as the second argument ($nullable)
instead of the third argument ($builtInOnly).
This caused the $builtInOnly parameter to default to false when
processing list items, resulting in the PHP mapped type being used
instead of the primitive JSON type in $data parameter docblocks.
Example of the bug:
- GraphQL: currencies: [Currency!]!
- Config: withScalar('Currency', Type::string(), Type::object(Currency::class))
- Generated docblock: 'currencies': list<Currency> (wrong)
- Should be: 'currencies': list<string> (correct)
This caused PHPStan errors like:
"Parameter #1 $code of class Money\Currency constructor expects
non-empty-string, Money\Currency given."1 parent 7725798 commit 97b518d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
| 96 | + | |
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| |||
0 commit comments