Skip to content
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

defaultValue missing from @Arg() #39

Open
tzarger opened this issue Mar 23, 2020 · 2 comments
Open

defaultValue missing from @Arg() #39

tzarger opened this issue Mar 23, 2020 · 2 comments
Labels

Comments

@tzarger
Copy link

tzarger commented Mar 23, 2020

In your documentation of Arg https://decapi.netlify.com/docs-docs-explore-arg it shows having a defaultValue such as @Arg({ nullable: true, defaultValue: 2 }) exponent: number. Yet the API and the TS Types don't include defaultValue as a valid known property.

@capaj
Copy link
Owner

capaj commented Apr 3, 2020

nicely spotted. I think I removed it because this feature is not really needed-you should be able to use default parameters as they work in JS/TS.
Making it look like: @Arg({ nullable: true}) exponent = 2

but I will definitely check if this works as expected. Maybe add a spec for this too.

@tzarger
Copy link
Author

tzarger commented Apr 3, 2020

@capaj Thanks for your response. I tried that, but when you do that the schema thinks it is not nullable since the variable is not nullable.

Overall, { isNullable: true} is broken complete in both @Arg() and @ArgNullable()

@capaj capaj added the docs label Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants