Closed CowDotDev closed 2 years ago
@CowDotDev typesFile
config should do this for you
Try to set it to: typesFile: './generated.ts'
instead.
This config will be used to add imports types from ./generated.ts
Hope that helps!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
For anyone coming here having the same issue with codgen.ts
, you need to put typesFile
within config
:
'path/to/mocks.ts': {
plugins: [
'typescript-mock-data',
],
config: {
typesFile: './index.ts'
}
}
https://github.com/ardeois/graphql-codegen-typescript-mock-data/issues/15#issuecomment-1351649503
@ardeois Thank you for your quick reply - I am sorry I missed it until now. Thank you and @TomasBarry I will take a look at this again once we come back around to it, definitely would still be a huge help!
My apologies if I am just missing something dumb - but I have implemented this typescript-mock-data plugin and am seeing the functions generated successfully. However, the
generated-mocks.ts
files does not import any of the types from thegenerated-types.ts
file so TypeScript compilation fails on this file.What do I need to do in order to have the
generated-mock.ts
file reference the types graphql-codegen generates?Thank you in advanced!
codegen.yml