Im working on porting a flow type generator that comes with a library ( Relay ) that generates TypeScript types but there are some questions about the Flow syntax that is not clear to me in this fragment :
import type { FragmentReference } from 'relay-runtime';
export opaque type TypenameInside$ref: FragmentReference = FragmentReference;
export type TypenameInside = ({|
+__typename: 'User',
+firstName: ?string,
+$refType: TypenameInside$ref,
|} | {|
+__typename: 'Page',
+username: ?string,
+$refType: TypenameInside$ref,
|} | {|
// This will never be '%other', but we need some
// value in case none of the concrete values match.
+__typename: '%other',
+$refType: TypenameInside$ref,
|});
Namely, what is $ref
, $refType
and %other
? Or are they not flow specific, but rather relay specific?
I tried looking for documents and a stream stream repo, but it was very difficult for me to find the answers. Links to documents and / or relevant parts of the implementation will also be very useful.
alloy source
share