facebook / facebook/relay

Enhancement of the customScalars format for typescript

Open
#2,830 19 comments 9 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

As of today, the customScalars format is straightforward, just a string / string mapping, and then limit the use of custom scalars to native types.
The customScalars format can be enhanced to support more complex types:
A proposal can be:
```typescript
const customScalars = {
MyType: {
type: 'MyType',
module: '../myModule'
},
MySimpleString: 'String'
}
```

this will add
```typescript
import { MyType } from '../myModule';
```

in the generated file.
Do you agree with that format?
I can do a PR on the [relay-tools/relay-compiler-language-typescript](/relay-tools/relay-compiler-language-typescript) repo.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.