graphile-test
Robust GraphQL Testing Utilities
Build on top of pgsql-test to provide robust GraphQL testing utilities for PostGraphile-based projects with seamless setup for isolated, seeded, role-aware databases.
Per-test Rollback
Via savepoints for complete isolation
RLS-aware Context
Inject authentication contexts with setContext
GraphQL Integration
Testing with query() and snapshot support
graphile-test Features
Streamline your GraphQL testing workflow
Per-test Transaction Rollbacks
Every test runs in its own savepoint for complete isolation, ensuring clean state between GraphQL operations.
RLS-aware Context Injection
Use setContext() to simulate different user roles and authentication states for testing Row-Level Security.
GraphQL Integration Testing
Built-in query() function with snapshot support for comprehensive GraphQL mutation and query testing.
Flexible Seed Support
Support for .sql files, JSON, CSV, or pgpm seeding strategies for comprehensive test setup.
Introspection Query Snapshotting
Capture and track changes in your GraphQL schema and query results with built-in snapshot testing.
Raw SQL Fallback
Drop into raw SQL testing anytime via pg.client.query for maximum flexibility when needed.