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
It fixes the issue with imports in declaration file.
I lose ability to use UserModule namespace without importing it but at least it's working and importing a type is okay for me.
Environment:
OS: macOS 10.14
@graphql-codegen/cli: 2.6.2
@graphql-codegen/graphql-modules-preset: 2.3.8
@graphql-codegen/typescript: 2.4.8
@graphql-codegen/typescript-resolvers: 2.6.1
NodeJS: v16.14.0
Additional context
I've also tried to skip using namespaces with encapsulateModuleTypes set to none:
If I set filename and baseTypesPath file types to just .ts instead of .d.ts I can make it work.
However, .ts files will be compiled so I'd love to use .d.ts file types.
Describe the bug
I'm trying to use modular types and save them in
*.d.ts
files so they are not compiled:The result file is:
Result File
Building an app gives errors for this file declaration:
Expected behavior
I'm not a TS expert, but it somehow should work. I've tried to manually move import at the top:
It fixes the issue with imports in declaration file.
I lose ability to use
UserModule
namespace without importing it but at least it's working and importing a type is okay for me.Environment:
@graphql-codegen/cli
: 2.6.2@graphql-codegen/graphql-modules-preset
: 2.3.8@graphql-codegen/typescript
: 2.4.8@graphql-codegen/typescript-resolvers
: 2.6.1Additional context
I've also tried to skip using namespaces with
encapsulateModuleTypes
set tonone
:After generation,
import
is gone for some reason:If I set
filename
andbaseTypesPath
file types to just.ts
instead of.d.ts
I can make it work.However,
.ts
files will be compiled so I'd love to use.d.ts
file types.Related #5260
The text was updated successfully, but these errors were encountered: