Gorka CesiumG
Convex Community3y ago
17 replies
Gorka Cesium

Schema / Types things

I would like to know which would be the ideal pattern to type a schema in convex so it plays well with a typed language like TS or Rescript.

My original idea would be to write the schema, for example:

type Customer = {
  name: string,
  email: string
}


But then I have two queries in the app that fetch different parts of the customer.
query getCustomers : array<Customer({ name, email })>

query getCustomerEmail : Customer({ email })


In this case would I need to create an additional type for the response getCustomerEmail?
Was this page helpful?