-
-
Notifications
You must be signed in to change notification settings - Fork 674
Closed
Labels
Community 👨👧Something initiated by a communitySomething initiated by a communityInvalid 👎This doesn't seem rightThis doesn't seem right
Description
Describe the Bug
When defining a default value for an input type, its default values are not applied. I am not sure if its a problem of type-graphql or graphql-js.
To Reproduce
@InputType()
class MyInput {
@Field(() => Int, { defaultValue: 30 })
public take!: number;
}
@Resolver()
class MyResolver {
@Query(() => Boolean)
public myQuery(@Arg('arg', { defaultValue: {} }) arg: MyInput): boolean {
console.log(arg);
return true;
}
}
{
myQuery
}
with this query the log output is {}
Expected Behavior
the log output should be {take:30}
Environment (please complete the following information):
- Docker: node:12-alpine
- Package version: 0.18.0-beta.17
- TypeScript version: 3.8.3
Metadata
Metadata
Assignees
Labels
Community 👨👧Something initiated by a communitySomething initiated by a communityInvalid 👎This doesn't seem rightThis doesn't seem right