i.sona
i.sona
CCConvex Community
Created by i.sona on 12/12/2024 in #support-community
Error in return types
I am getting the error below
Uncaught Error: Result {"data":"undefined","error":"Unauthorized"}
Uncaught Error: Result {"data":"undefined","error":"Unauthorized"}
when i call a query or a mutation simply because i am returning a Result type
export class Result<T> {
constructor(
public readonly data?: T,
public readonly error?: string
) {}

get isOk(): boolean {
return this.error === undefined
}

static success<T>(data: T): Result<T> {
return new Result(data)
}

static failure<T>(error: Error): Result<T> {
console.log('error', error)
return new Result<T>(undefined, error?.message)
}
}
export class Result<T> {
constructor(
public readonly data?: T,
public readonly error?: string
) {}

get isOk(): boolean {
return this.error === undefined
}

static success<T>(data: T): Result<T> {
return new Result(data)
}

static failure<T>(error: Error): Result<T> {
console.log('error', error)
return new Result<T>(undefined, error?.message)
}
}
i do not want to throw in any case and handle the response in the calling application .
3 replies
CCConvex Community
Created by i.sona on 10/18/2024 in #support-community
Can I use Tanstack Start Without react-query
I wish to know if its possible and Ok to use tanstack-start with Convex directy without react-query . Or is react-query a must for this combo
4 replies
CCConvex Community
Created by i.sona on 9/28/2024 in #support-community
How do i create a schema object with computed fields
using convex.dev and or convex-ents , how do i define a computed field. If i have an entity user defined in my schema with fields first name and last name, how do i define a fullname field that concats first and last name. This is just an example, it can be any computed field
7 replies
CCConvex Community
Created by i.sona on 9/23/2024 in #support-community
convex-auth with sveltekit
Hi Here, While convex references and examples are react-heavy (react-focused) , i want to ask if anyone has been successful in implementing convex-auth with sveltekit , particularly with session validation in server hooks . Thanks
3 replies