This repository was archived by the owner on Sep 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -451,6 +451,9 @@ function createVisitor(options: TypeGeneratorOptions): IRVisitor.NodeVisitor {
451
451
refTypeFragmentRefProperty
452
452
] ) ;
453
453
454
+ const dataTypeName = getDataTypeName ( node . name ) ;
455
+ const dataType = ts . createTypeReferenceNode ( node . name , undefined ) ;
456
+
454
457
const unmasked = node . metadata != null && node . metadata . mask === false ;
455
458
const baseType = selectionsToAST (
456
459
selections ,
@@ -468,6 +471,7 @@ function createVisitor(options: TypeGeneratorOptions): IRVisitor.NodeVisitor {
468
471
...getFragmentRefsTypeImport ( state ) ,
469
472
...getEnumDefinitions ( state ) ,
470
473
exportType ( node . name , type ) ,
474
+ exportType ( dataTypeName , dataType ) ,
471
475
exportType (
472
476
refTypeName ,
473
477
isPluralFragment
@@ -930,6 +934,10 @@ function getRefTypeName(name: string): string {
930
934
return `${ name } $key` ;
931
935
}
932
936
937
+ function getDataTypeName ( name : string ) : string {
938
+ return `${ name } $data` ;
939
+ }
940
+
933
941
// Should match FLOW_TRANSFORMS array
934
942
// https://github.com/facebook/relay/blob/v6.0.0/packages/relay-compiler/language/javascript/RelayFlowGenerator.js#L621-L627
935
943
export const transforms : TypeGenerator [ "transforms" ] = [
You can’t perform that action at this time.
0 commit comments