Closed ellemedit closed 2 years ago
The Relay Resolvers is still in active development, and typescript support maybe lacking in some places. Thanks for reporting!
Thanks for the report @Beingbook. If you're interested in working on a fix, I suspect stripping the extension would be the right approach and the I think the code that derives this path lives here: https://github.com/facebook/relay/blob/main/compiler/crates/relay-config/src/project_config.rs#L360
cc @tbezman
oops, I'm too late. thank you for suggesting contribution! I want to work if there's next time.
This was not fixed in 14.1 - the dynamic imports in the AST omit extensions, however the type imports still have the extensions.
It appears that https://github.com/facebook/relay/blob/639abe1b23ed2187500514c331bed3aebede2f02/compiler/crates/relay-typegen/src/typescript.rs#L97 and https://github.com/facebook/relay/blob/639abe1b23ed2187500514c331bed3aebede2f02/compiler/crates/relay-typegen/src/typescript.rs#L101
Both also need to strip extensions, as typescript requires that extensions not be provided.
Is it possible to re-open this? I'm happy to work on a fix.
I went ahead and created a new issue:
As above images, generated relay artifacts import relay resolver with extension. I think using ".js" extension or skipping extension are correct solution at this moment. So we can inference return type of RelayResolver function in TypeScript.