Currently the modules generated for the files have a wildcard as path. Example: declare module '*/Project.gql' {
I would like an option to generate the files with the absolute path (src/graphql/queries/Project.gql). This way auto-imports will work correctly in VS Code
I implemented it in this PR: https://github.com/dotansimha/graphql-code-generator/pull/3010
With these changed, you should be able to set now relativeToCwd: true to generate a complete path to CWD, and you can customize the prefix (default for */).
@pietdevries94
Available in 1.9.0
@dotansimha
How can I set the option for typescript-files-modules?
@tyankatsu0105 For me it works using something like:
generates:
src/types/graphql.d.ts:
plugins:
- 'typescript-graphql-files-modules'
config:
relativeToCwd: true
Would be awesome if these would generate files in-place, so that I'd get a .d.ts file for each document
Most helpful comment
@tyankatsu0105 For me it works using something like: