Describe the bug
The types generated for operations with variables that have set defaults are wrong, and force a value.
To Reproduce
Steps to reproduce the behavior:
extend type Mutation {
setUserActive(id: ID!, active: Boolean!): Boolean
}
mutation SetUserActive($id: ID!, $active: Boolean = true) {
setUserActive(id: $id, active: $active)
}
codegen.yml config file:overwrite: true
documents:
- src/client/**/documents.graphql
schema:
- src/client/**/*schema.graphql
generates:
src/client/generated/graphql.ts:
config:
avoidOptionals: false
immutableTypes: true
plugins:
- typescript
- typescript-operations
- typescript-apollo-angular
src/client/generated/schema-client.graphql:
plugins:
- "schema-ast"
Expected behavior
I expect the generated Variable type to allow active to be optional
Environment:
@graphql-codegen/[email protected]: I released a canary version, could you try: 1.0.5-alpha-4b26c306.0+4b26c306?
Fixed in 1.0.5.