dotansimha / dotansimha/graphql-code-generator

arrayInputCoercion not working

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

Description

### Discussed in https://github.com/dotansimha/graphql-code-generator/discussions/8191

Originally posted by **markedwards** August 5, 2022
I have the following codegen.yml:
```
overwrite: true
schema: "lib/api/schema.graphql"
documents: "lib/api/(fragments|mutations|queries)/**/*.ts?(x)"
generates:
lib/api/types.ts:
config:
avoidOptionals:
field: true
namingConvention:
enumValues: keep
nonOptionalTypename: true
plugins:
- "typescript"
- "typescript-operations"
```
I'm not seeing arrayInputCoercion applied. In other words, array properties of input types are generated as only an array, rather than either an array or a single value of the given type.

Does this only work on variables, and not on input types?

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.