You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to ensure type safety, generated typescript files should not be exported with @ts-nocheck. This is currently present in both generated types for resolvers as well as generated fragments which are referenced from components. In order to create type assertions within this file, we will need to begin type-checking these files.
Related: #4742
This is part of the requirement for the resolver context work mentioned in #4000 and #4704
The text was updated successfully, but these errors were encountered:
Summary:
A fix for a typescript generation bug discovered from the work in #4753, with efforts to enable checking for all TS generated files #4745
This fixes a class of Typescript errors in generated typescript files with TS checking enabled:
```
/src/__generated__/mutation.graphql.ts(11,27): error TS2305: Module '"relay-runtime"' has no exported member 'Mutation'.
/src/__generated__/mutation.graphql.ts(11,27): error TS6133: 'Mutation' is declared but its value is never read.
```
The root cause is the exported type is both not exported by the TS types, and not used due to typescript using the `export default` syntax.
Where flow would generate the following export:
```
module.exports = ((node/*: any*/)/*: Mutation<
validateMutationTest9ChangeNameIncludeMutation$variables,
validateMutationTest9ChangeNameIncludeMutation$data,
>*/);
```
Typescript would generate the following, not using the `Mutation` type:
```
export default node;
```
This fix removes the extraneous import type when the language is set as typescript.
Pull Request resolved: #4754
Differential Revision: D60604034
fbshipit-source-id: f38fc80bba3b549a22ebbca544dca1f9e940cce0
In order to ensure type safety, generated typescript files should not be exported with
@ts-nocheck
. This is currently present in both generated types for resolvers as well as generated fragments which are referenced from components. In order to create type assertions within this file, we will need to begin type-checking these files.Related: #4742
This is part of the requirement for the resolver context work mentioned in #4000 and #4704
The text was updated successfully, but these errors were encountered: