mirror of
https://github.com/supabase/supabase.git
synced 2026-10-14 13:49:09 +03:00
The first PR in a series to build out the Content API. Adds a dummy GraphQL route with some tests: for now all this does is validate the request body and return a 404.
30 lines
403 B
TypeScript
30 lines
403 B
TypeScript
import { z } from 'zod'
|
|
|
|
export class ApiError extends Error {
|
|
constructor(message: string) {
|
|
super(message)
|
|
}
|
|
|
|
isPrivate() {
|
|
return true
|
|
}
|
|
|
|
statusCode() {
|
|
return 500
|
|
}
|
|
}
|
|
|
|
export class InvalidRequestError extends ApiError {
|
|
constructor(message: string) {
|
|
super(`Invalid request: ${message}`)
|
|
}
|
|
|
|
isPrivate() {
|
|
return false
|
|
}
|
|
|
|
statusCode() {
|
|
return 400
|
|
}
|
|
}
|