Following get started tuto - getTasks list not generated

I am following this article here https://wasp-lang.dev/docs/tutorials/todo-app/03-listing-tasks To use the prepared logic on frontend, article says I need to import my fetching function and useQuery hook like so
import getTasks from '@wasp/queries/getTasks'
import { useQuery } from '@wasp/queries'
import getTasks from '@wasp/queries/getTasks'
import { useQuery } from '@wasp/queries'
but for me getTasks is not importing, because there is no such file is generated. Why could this be and what am I doing wrong? What can I provide to help you debug this?
Listing tasks | Wasp
We want to admire our tasks, so let's list them!
19 Replies
IamIconLiving
IamIconLivingOPβ€’2y ago
my main.wasp file
app WaspApp {
wasp: {
version: "^0.10.0"
},
title: "My Wasp App - TS"
}

route RootRoute { path: "/", to: MainPage }

page MainPage {
component: import Main from "@client/MainPage.tsx"
}

entity Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
psl=}

query getTasks {
fn: import { getTasks } from "@server/queries.js",
entities: [Task]
}
app WaspApp {
wasp: {
version: "^0.10.0"
},
title: "My Wasp App - TS"
}

route RootRoute { path: "/", to: MainPage }

page MainPage {
component: import Main from "@client/MainPage.tsx"
}

entity Task {=psl
id Int @id @default(autoincrement())
description String
isDone Boolean @default(false)
psl=}

query getTasks {
fn: import { getTasks } from "@server/queries.js",
entities: [Task]
}
My src/server/queries.ts file
import { GetTasks } from "@wasp/queries/types";

export const getTasks: GetTasks = async (args, context) => {
return context.entities.Task.findMany();
};
import { GetTasks } from "@wasp/queries/types";

export const getTasks: GetTasks = async (args, context) => {
return context.entities.Task.findMany();
};
shayne
shayneβ€’2y ago
Hi there @IamIconLiving πŸŽ„ πŸ‘‹ are you doing these updates while running wasp start by chance? the Wasp compiler will be in watch mode then and re-compile your app as files change. this is required to create files (like your query files) as your .wasp file changes. you can also run wasp compile as a one off to try. let me know if that doesn't do the trick you should also see your query files here when generated by Wasp: <your-project-dir>/.wasp/out/web-app/src/queries ☝️ for debugging sake only, you just need to only edit files in your actual project dir, not the generated .wasp output folder πŸ™‚
IamIconLiving
IamIconLivingOPβ€’2y ago
yep I found the folder output, but it doesn't contain the file that I am trying to require restarted the dev server (or whatever it's called under the hood of wasp start) to no luck wasp compile doesn't help either
Vinny (@Wasp)
Vinny (@Wasp)β€’2y ago
hm that is very odd. If you want we can jump on a call real quick
IamIconLiving
IamIconLivingOPβ€’2y ago
sure
Vinny (@Wasp)
Vinny (@Wasp)β€’2y ago
send me a dm @shayne wasp clean did the trick
shayne
shayneβ€’2y ago
hmm, interesting! good find Vinny. we should probably understand and try to replicate what happened internally
Vinny (@Wasp)
Vinny (@Wasp)β€’2y ago
it seemed when he tried to import react 18 as a depenency it caused a weird issue that's my guess
shayne
shayneβ€’2y ago
ah yes, that makes sense, i think that probably got things into a funky state πŸ‘
IamIconLiving
IamIconLivingOPβ€’2y ago
Thanks for all your help guys, much appreciated! πŸ’ͺ
Vinny (@Wasp)
Vinny (@Wasp)β€’2y ago
You're welcome. how's it working out?
IamIconLiving
IamIconLivingOPβ€’2y ago
It’s actually going well! I am also writing down my impressions and experience in a short recap so it’s easier to digest for you guys and maybe take something useful out of it
MEE6
MEE6β€’2y ago
Wohooo @IamIconLiving πŸŽ„, you just became a Waspeteer level 2!
IamIconLiving
IamIconLivingOPβ€’2y ago
From a newbie point of view I Will share it later once I have time to finish
Vinny (@Wasp)
Vinny (@Wasp)β€’2y ago
that's super useful, thanks! Would you be interested in joining a call next week to tell us about it? Would help us out a lot. If so, @matijash can send you an invite link
matijash
matijashβ€’2y ago
ooh yeah that would be amazing @IamIconLiving πŸŽ„ πŸ™‚
matijash
matijashβ€’2y ago
Feel free to grab sth here for the next week if it works πŸ™‚ https://usemotion.com/meet/matija-sosic-8fm/cc2rpm3?d=20
Please choose a time on my Motion page
I’ve shared my calendar availability with you through Motion. Please choose a time that works for you.
IamIconLiving
IamIconLivingOPβ€’2y ago
Absolutely, no problem! Will send an invite through this thing once back to PC
matijash
matijashβ€’2y ago
awesome, really looking fwd πŸ™‚
Want results from more Discord servers?
Add your server