graphql-let
graphql-let copied to clipboard
Generate types in place other than `node_modules` (v0.18.0)
Whenever I make a change to my packages and the node_modules
folder is updated, I have to regenerate the types. Is there a way I can specify a folder to generate types in, other than node_modules/graphql-let/__generated__/__types__
?.
Hi @cloudagon, I didn't know the behavior. Thanks for letting me know.
You probably mean node_modules/@types/graphql-let/__generated__/__types__.d.ts
, generated in the default typeInjectEntrypoint
directory. Not tested, but setting typeInjectEntrypoint: typings/graphql-let.d.ts
or something must avoid it.
It just generates an empty file in the specified location. This aligns with node_modules/@types/graphql-let/__generated__/index.d.ts
.
dirname(config.typeInjectEntrypoint)
is supposed to be a directory graphql-let generates types in, but I have no test case for it. The file having empty content is ok. It only gets to have declarations when needed. I'm happy if you (or anyone):
- describe what happens when you change
typeInjectEntrypoint
and what problem remains still - make a PR of the reproduction test case
- make a PR to solve it
When I set the following:
typeInjectEntrypoint: src/types/graphql-let
no types are generated. An empty file called graphql-let
is generated in src/types
and the node_modules/@types/graphql-let
is not created.
full config:
schema: src/graphql/**/*.graphqls
documents: src/graphql/**/*.graphql
typeInjectEntrypoint: src/types/graphql-let
plugins:
- typescript-operations
- typescript-react-apollo
config:
enumValues:
Language: '@prisma/client#Language'
enumPrefix: GQL
cacheDir: .cache/graphql-let
I'm willing to look into this, but I'm not even sure where to start.