'How call flow function by TypeScript

Now I'm developing an open source framework https://github.com/babyfish-ct/graphql-ts-client/ .In 3.X, I want to integrate with relay(not fully finished).

I need to make relay-compiler invisible to developers, so I need to call a function named create in relay-compiler, which is defined in node_modules/relay-compiler/core/Schema.js.flow.

relay-compiler/core/Schema.js.flow

Unfortunately, this function is not disclosed in @types/relay-compiler, and loading it from this "js.flow" is the only way. However, I am not familiar with flow, how to use typescript to call this "create" function?



Solution 1:[1]

Ok, this problem is resolved. Use node_modules/relay-compiler/lib/core/Schema.js

JavaScript API

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Tao Chen