graphql-zeus icon indicating copy to clipboard operation
graphql-zeus copied to clipboard

Typescript Import Fails after generating `--node `

Open lukepolo opened this issue 2 years ago • 1 comments

After running the script

zeus http://hasura:8080/v1/graphql ./generated/hasura --node --header=x-hasura-admin-secret:$HASURA_ADMIN_SECRET

It will generate

image

But inside index.ts it tries to include a .js file

import { AllTypesProps, ReturnTypes, Ops } from './const.js';

This breaks the build process

lukepolo avatar Mar 23 '23 20:03 lukepolo

i found that this line breaks it

https://github.com/graphql-editor/graphql-zeus/blob/4a309df2b77dde9a4dfcf52b8adff371f6ff79cc/packages/graphql-zeus-core/TreeToTS/index.ts#L109C42-L109C42

 indexImports: `import { AllTypesProps, ReturnTypes, Ops } from './const${
        esModule || env === 'node' ? '.js' : ''
      }';`.concat(

lukepolo avatar Aug 22 '23 18:08 lukepolo

one of the latest releases seems to have fixed this issue for me.

lukepolo avatar Jul 25 '24 02:07 lukepolo