Yep, you can organize these exactly like
Yep, you can organize these exactly like this! Then on the client you'd use
api.transactions.queries.yourQueryName
to specify the query named yourQueryName
exported from convex/transactions/queries.ts
8 Replies
OK good to know. I just tried it however and I do not see my functions in the web dashboard
(after running npx..)
I do not have much javascript experience though, so if I'm supposed to have an
index
file or do something to initialize the transactions
, I did not do itWHat's the output of
npx convex dev -v
look like?
(this should list all the files that are found)also could you show what a few lines of the queries.ts file looks like, include an export?
Is
convex/contracts/tuberProxy.ts
the one you expect to see here?no, but the functions I do not see in the dashboard are defined in
contracts/tuberProxy.js
oh one sec
maybe the export
are http actions only included in the dashboard if they are registered in the convex/http
file?Ah yes, http actions must be in the http.ts file.
You can define them elsewhere and then import them in convex/http.ts and add the routes there, but the actual http object needs to be exported from convex/http.ts.
got it ok let me try with a normal query then
that did it. Thank you!
hey small question - any way we can use a different filename for the
convex.json
file? Autocomplete for the convex/
directory is always prompting between these two optionsGreat idea, possible workaround for now would be naming your convex folder something different by setting the
functionsDir
key in convex.json
.
It's not out of the question to check two locations for convex.json though, feedback noted.