orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
Generating everything in one file with the single mode results in a 20k line file which is obviously not ideal, makes my IDE freeze and file operations take extremely long time to finish. So I naturally choose the tags-split mode in orval, but when I tried to set up mocks according to the examples, I faced the following issue.
I couldn't find a way to have a single function that exports all the mock functions. I figured it should be something like export const handlers = getMyApiMSW() in handlers.js but currently I can only do that in 'split' mode as it generates a separate .msw file for mocks.
Question is, can we have an index.mocks.ts file or similar generated that exports only the mock functions but all of them?
(Using react-query client if it makes a difference.)
Generating everything in one file with the
single
mode results in a 20k line file which is obviously not ideal, makes my IDE freeze and file operations take extremely long time to finish. So I naturally choose thetags-split
mode in orval, but when I tried to set up mocks according to the examples, I faced the following issue. I couldn't find a way to have a single function that exports all the mock functions. I figured it should be something likeexport const handlers = getMyApiMSW()
inhandlers.js
but currently I can only do that in 'split' mode as it generates a separate.msw
file for mocks.Question is, can we have an
index.mocks.ts
file or similar generated that exports only the mock functions but all of them? (Using react-query client if it makes a difference.)Thank you, awesome tool btw!
Edit: related to https://github.com/anymaniax/orval/issues/347