dotansimha / dotansimha/graphql-code-generator

Resolvers input subfields with defaults resolve into nullable

Open
#8,119 6 comments 0 reactions 1 assignee Claimed by @charlypoly View on GitHub
core
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

### Describe the bug

Resolvers input subfields with defaults resolve into nullable

### Your Example Website or App

https://stackblitz.com/edit/node-ve8vhp?file=schema.graphql

### Steps to Reproduce the Bug or Issue

```
typescript-resolvers:
overwrite: true
schema:
- schema.graphql

documents: null
generates:
generated-types.ts:
plugins:
- 'typescript'
- 'typescript-resolvers'

```

and this is the schema:
```
type User {
name: String
}

input GetUserArgs {
offset: Int = 0
}

type Query {
getUsers(getUsersArgs: GetUserArgs): [User]
}

```
### Expected behavior

for `offset` arg to be wrapped with `RequireFields` in the. resolver type

### Screenshots or Videos

_No response_

### Platform

- OS: macOS
- NodeJS: 16.14.2
- `graphql` version: 16.0.1
- "@graphql-codegen/cli": "2.9.0"
- "@graphql-codegen/typescript": "2.7.2"
- "@graphql-codegen/typescript-resolvers": "2.7.2"

### Codegen Config File

_No response_

### Additional context

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.