W
Wasp-lang•12mo ago
Dayne

[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
MEE6
MEE6•12mo ago
Wohooo @Dayne, you just became a Waspeteer level 1!
miho
miho•12mo ago
Could you maybe share some code you tried writing? It should be entirely possible to do that 😊
Dayne
DayneOP•12mo ago
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 import
Dayne
DayneOP•12mo ago
No description
Dayne
DayneOP•12mo ago
Ok. 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?
Vinny (@Wasp)
Vinny (@Wasp)•12mo ago
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
Want results from more Discord servers?
Add your server