AdamGT
AdamGT2mo ago

...authTables not showing in api client

Even though I added the ...authTables to the schema they are not showing in the api client but they are showing on the website
import { defineSchema, defineTable } from "convex/server";
import { authTables } from "@convex-dev/auth/server";
import { v } from "convex/values";

const schema = defineSchema({
...authTables,
shirt: defineTable({
intro: v.boolean(),
color: v.string(),
tweetLink: v.string(),
userId: v.optional(v.id("users")),
}),
});

export default schema;
import { defineSchema, defineTable } from "convex/server";
import { authTables } from "@convex-dev/auth/server";
import { v } from "convex/values";

const schema = defineSchema({
...authTables,
shirt: defineTable({
intro: v.boolean(),
color: v.string(),
tweetLink: v.string(),
userId: v.optional(v.id("users")),
}),
});

export default schema;
const user = useQuery(api.users.viewer);
const user = useQuery(api.users.viewer);
the query above is giving this error "property users not exist on type ... all the above tables except the authTables"
3 Replies
Convex Bot
Convex Bot2mo ago
Thanks for posting in <#1088161997662724167>. Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets. - Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.) - Use search.convex.dev to search Docs, Stack, and Discord all at once. - Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI. - Avoid tagging staff unless specifically instructed. Thank you!
erquhart
erquhart2mo ago
If api.users.viewer is throwing that error it means you don't have an exported query named viewer in convex/users.ts (some details may vary) api maps to your exported functions, not to your schema tables
AdamGT
AdamGTOP2mo ago
oh makes sense thank you

Did you find this page helpful?