Files
supabase/supabase/seed.sql
T
Charis aba0095bd7 feat(content api): add error endpoint (#35941)
* feat(content api): add error endpoint

Add an endpoint to return the details of a Supabase error, given the
error code and service.

Schema additions:

```graphql
type RootQueryType {
  "...previous root queries"

  """Get the details of an error code returned from a Supabase service"""
  error(code: String!, service: Service!): Error
}

"""An error returned by a Supabase service"""
type Error {
  """
  The unique code identifying the error. The code is stable, and can be used for string matching during error handling.
  """
  code: String!

  """The Supabase service that returns this error."""
  service: Service!

  """The HTTP status code returned with this error."""
  httpStatusCode: Int

  """
  A human-readable message describing the error. The message is not stable, and should not be used for string matching during error handling. Use the code instead.
  """
  message: String
}

enum Service {
  AUTH
  REALTIME
  STORAGE
}
```

* test(content api): add tests for top-level query `error`
2025-05-29 15:39:47 -04:00

19 lines
518 B
SQL

insert into meetups
(title, country, launch_week, start_at, is_published)
values
('New York', 'USA', 'lw12', now(), true),
('London', 'UK', 'lw12', now(), true),
('Singapore', 'Singapore', 'lw12', now(), true);
insert into public.launch_weeks (id) values ('lw14');
-- Insert mock error codes for testing
insert into content.error (code, service, http_status_code, message)
values
(
'test_code',
(select id from content.service where name = 'AUTH'),
500,
'This is a test error message'
);