You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
melloware
changed the title
Is there a way to have a single export for mocks in tags-split mode?
Mocks: Is there a way to have a single export for mocks in tags-split mode?
Nov 13, 2023
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 like
export 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 #347
The text was updated successfully, but these errors were encountered: