Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Cannot use enum values imported from GraphQL Codegen types

$
0
0

Whenever I import enums from graphql-codegen generated types and use their values, the app fails to start.

import { MyEnum } from 'graphql-types.ts';let x: MyEnum; // This worksx = MyEnum.MY_ENUM_VALUE; // Whenever I use this code, it fails

TypeScript does not show any errors in the code, but the app fails to run showing the error message below.

Android Bundling failedSyntaxError: graphql.types.ts: Identifier 'Document' has already been declared.export const Document = gql`...

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>