-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default enum value for argument when using annotations #1149
Comments
Hi @mathroc! Would you have a complete stack trace of the error plz? |
sure:
|
the workaround I mentioned isn't working in fact. It allows to build the types but at runtime it fails when the argument is omitted because the default is a string, so the reverse transformation isn't happening either for the default stack trace:
so the only workaround I could find is by making the argument nullable and having a null default: #[GQL\Query]
public function messages(
int $page = 0,
int $pageSize = 100,
?ResolveStrategy $strategy = null,
): ?Message {
$strategy ??= ResolveStrategy::InMemory; |
With something liek this:
It gives me this error:
I suppose the enum value is not serialized to its name somewhere when generating the types
Specifying the arguments in the
[GQL\Arg]
attribute bypass the issueThe text was updated successfully, but these errors were encountered: