W
Wasp-langβ€’6mo 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β€’6mo ago
Wohooo @Dayne, you just became a Waspeteer level 1!
miho
mihoβ€’6mo ago
Could you maybe share some code you tried writing? It should be entirely possible to do that 😊
Dayne
Dayneβ€’6mo 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
Dayneβ€’6mo ago
No description
Dayne
Dayneβ€’6mo 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)β€’6mo 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