Closed mdazy closed 4 years ago
Hi @mdazy
I think you are missing an indentation when you declare typesFile
It should be:
plugins:
- typescript-mock-data:
typesFile: ./clientTypes.tsx
You're right. I just hit tab and thought it was indented correctly but I didn't realize the parameter was in fact aligned with the hyphen level. It does work with the correct indentation. Thanks!
For anyone coming here having the same issue with codgen.ts
as opposed to codegen.yml
, you need to put typesFile
within config
:
'path/to/mocks.ts': {
plugins: [
'typescript-mock-data',
],
config: {
typesFile: './index.ts'
}
}
Hello,
the generated code appears to use the generated types without ever importing them first. As a result, as soon as I try to use one of the mock functions, I'm getting errors for each generated mock:
My codegen config is like this:
I'm pretty sure I must be missing something very basic but I just can't figure out what.
Thanks,