dotansimha / dotansimha/graphql-code-generator

Scalar wrongly interpreted as template literal

Open
#7,763 3 comments 0 reactions 0 assignees View on GitHub
core
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

Hello,

Are the scalars from `graphql-scalars` somehow supposed to be matched with their TypeScript counterpart out-of-the box? I don’t immediately see how, so I’m using the `scalars` field in `codegen.yml` to configure, amongst other values, `EmailAddress`:

```yml
scalars:
EmailAddress: '`${string}@${string}.${string}`'
```

This gets turned into

```
`undefined@undefined.undefined`
```

Instead of

```
`${string}@${string}.${string}`
```

Is there any way to circumvent this? Of course I can always just revert to `string` as a workaround.

Thanks!

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.