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, LaunchQL, or Sqitch 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.

Quick GraphQL Testing Setup

Get started with GraphQL testing in seconds. Built on top of pgsql-test with seamless PostGraphile integration for isolated, role-aware testing.

Role-Based Security Testing

Test Row-Level Security policies by switching between different user roles and authentication contexts. Perfect for testing GraphQL resolvers with proper authorization.

Typed GraphQL Operations

Use TypeScript interfaces for type-safe GraphQL testing with full IntelliSense support and compile-time error checking.