Relay: Type generation for custom scallars

Created on 5 May 2019  路  4Comments  路  Source: facebook/relay

Something like this:

backingTypeMap: {
  EmailAddress: 'string',
  DateTime: 'string',
  Max1024Chars: 'string',
  Max140Chars: 'string',
  URL: 'string',
},

It would be awesome.

Most helpful comment

I currently solve this by copying RelayCompilerBin and RelayCopilerMain into the project and replacing empty customScalars: {} with this.

        customScalars: {
          Date: 'String',
          DateTime: 'String',
        }

AFAIK guys discuss config file which should solve this problem.

All 4 comments

I currently solve this by copying RelayCompilerBin and RelayCopilerMain into the project and replacing empty customScalars: {} with this.

        customScalars: {
          Date: 'String',
          DateTime: 'String',
        }

AFAIK guys discuss config file which should solve this problem.

I do the same thing, replace in the generated compiler bin and then check that into VCS. Not ideal, a config file would be very nice.

Right now you can use patch-package to make this easier

The right solution is a relay.config.js

This seems a duplicate of #2162, for which there鈥檚 a PR at #2745.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HsuTing picture HsuTing  路  3Comments

scotmatson picture scotmatson  路  3Comments

leebyron picture leebyron  路  3Comments

rayronvictor picture rayronvictor  路  3Comments

amccloud picture amccloud  路  3Comments