entropyE
Convex Community2y ago
30 replies
entropy

Is possible to export schema from nested folder?

Hello, I'm trying to achieve something like the setup below but I keep getting errors with my functions when I move the schema file. Is this possible?

convex/schema/index.ts
import { defineSchema } from 'convex/server'
import { Users } from './users'

export default defineSchema({
  users: Users.table.index('by_clerkId', ['clerkId'])
})


convex/schema/users.ts
import { Table } from 'convex-helpers/server'
import { v } from 'convex/values'

export const Users = Table('users', {
  // user fields here...
})
image.png
Was this page helpful?