Benanna19
Benanna19•2mo ago

Go app Convex updates

ok, so I have convex setup in my go app and can query data. Im sure this is something I just don't understand both about Go and about convex but I have to 'save' in my Go project for it to essentially rebuild if I want to see updated data from convex. so if I go to the convex dashboard, add a task, save, then refresh my project, it won't refresh the data but a save of my code will. could someone point my to my knowledge deficit 😅 I believe it is a Go misunderstanding so please feel free to ignore.
10 Replies
ballingt
ballingt•2mo ago
Can you share your code? We can blame Go or convex or your code 😆
Benanna19
Benanna19OP•2mo ago
Probably my code haha Just a sec
Benanna19
Benanna19OP•2mo ago
This is my main.go file for a simple route
No description
Benanna19
Benanna19OP•2mo ago
Here is my convex setup. I have db.go and a convex.go (modeled after the old example)
Benanna19
Benanna19OP•2mo ago
my convex.go where I have query and mutation functions and then db specifics, like LoadTasks and so on
No description
Benanna19
Benanna19OP•2mo ago
My db.go file
No description
Benanna19
Benanna19OP•2mo ago
It's not a huge deal right now just odd that it doesn't pickup on changes from the db on a simple refresh I feel obliged to say that if you see odd names in this starter it is because someone who created a good starter was feeling silly/cheeky and gave it a name I would not have chosen 🫠
erquhart
erquhart•2mo ago
we give all in service of the pun
lee
lee•2mo ago
It looks like you fetch tasks from convex when the go server starts up, and every time it receives a GET request it replies with those same tasks. To fix, you should be able to move db.LoadAllTasks into the app.Get callback so it runs on every refresh
Benanna19
Benanna19OP•2mo ago
This in fact did what I wanted, thanks!

Did you find this page helpful?