[SOLVED] Separate queries & actions to multiple files?
Anyone have success on splitting
queries.ts
and actions.ts
into multiple files and import? I have tried and it errors on importing for me. I would love to be able to split these out just for readability 🙂6 Replies
Wohooo @Dayne, you just became a Waspeteer level 1!
Could you maybe share some code you tried writing? It should be entirely possible to do that 😊
Sure! This is probably user error, but I can't seem to get the
actions.js
to import anything I add. 🤔 . For example, I created a /utils/actions.ts
and import with import { authorizeEntityAccess } from "./utils/actions";
. but getting an error on running with the importOk. I got it working with this solution: https://discord.com/channels/686873244791210014/1102320412462944286/1102320412462944286. 🎉 I also had to delete the
.wasp
directory and start fresh to get it to work. Is that expected?Hm that shouldn’t be necessary but sometimes it unfortunately is the case especially if the outputted files have been unknowingly changed.
you can also use
wasp clean
as a good way to reset things rather than manually deleting the outputted files next time