Files
Charis 4e916fc16a feat(graphql): add paginated errors collection query (#36149)
* feat(graphql): add paginated errors collection query

- Add new GraphQL query field 'errors' with cursor-based pagination

- Add UUID id column to content.error table for cursor pagination

- Implement error collection resolver with forward/backward pagination

- Add comprehensive test suite for pagination functionality

- Update database types and schema to support new error collection

- Add utility functions for handling collection queries and errors

- Add seed data for testing pagination scenarios

This change allows clients to efficiently paginate through error codes using cursor-based pagination, supporting both forward and backward traversal. The implementation follows the Relay connection specification and includes proper error handling and type safety.

* docs(graphql): add comprehensive GraphQL architecture documentation

Add detailed documentation for the docs GraphQL endpoint architecture, including:
- Modular query pattern and folder structure
- Step-by-step guide for creating new top-level queries
- Best practices for error handling, field optimization, and testing
- Code examples for schemas, models, resolvers, and tests

* feat(graphql): add service filtering to errors collection query

Enable filtering error codes by Supabase service in the GraphQL errors collection:
- Add optional service argument to errors query resolver
- Update error model to support service-based filtering in database queries
- Maintain pagination compatibility with service filtering
- Add comprehensive tests for service filtering with and without pagination

* feat(graphql): add service filtering and fix cursor encoding for errors collection

- Add service parameter to errors GraphQL query for filtering by Supabase service
- Implement base64 encoding/decoding for pagination cursors in error resolver
- Fix test cursor encoding to match resolver implementation
- Update GraphQL schema snapshot to reflect new service filter field

* docs(graphql): fix codegen instruction
2025-06-09 10:24:17 -04:00

26 lines
745 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'
),
('test_code2', (select id from content.service where name = 'AUTH'), 429, 'Too many requests'),
(
'test_code3',
(select id from content.service where name = 'REALTIME'),
500,
'A realtime error message'
);