Introduction
Welcome to PalJS - your comprehensive toolkit for building GraphQL APIs with Prisma.
Important: Choosing the Right Tool
For Production Applications: Use only the @paljs/plugins package with PrismaSelect. It provides secure, optimized field selection while you maintain full control over your GraphQL API.
For Learning & Prototyping: The code generators (Generator, Nexus, Admin) are perfect for quickly scaffolding APIs and learning Prisma + GraphQL patterns. They expose full Prisma operations and are not recommended for production use in large applications.
What is PalJS?
PalJS provides two distinct solutions:
Production: PrismaSelect Plugin
The @paljs/plugins package contains PrismaSelect — a production-ready utility that:
- Analyzes GraphQL queries and generates optimized Prisma
select/includeobjects - Only fetches the fields actually requested — no over-fetching
- Prevents N+1 query issues automatically
- Works with any GraphQL framework (Apollo, Yoga, etc.)
- Gives you full control over what operations are exposed
Learning & Prototyping: Code Generators
The generator packages help you learn Prisma + GraphQL patterns quickly:
- @paljs/generator — Native Prisma generator that creates GraphQL schemas, types, and admin UI
- @paljs/nexus — Nexus plugin for Prisma integration
- @paljs/admin — React admin UI components
These are ideal for:
- Learning how Prisma and GraphQL work together
- Building proof-of-concept applications
- Creating demo or example projects
- Rapid admin interface scaffolding
The generators expose full Prisma operations (create, update, delete, etc.) directly through GraphQL. In production, you typically want fine-grained control over:
- Which operations are exposed
- Input validation and authorization
- Business logic and data transformations
For production, write your own resolvers and use PrismaSelect for query optimization.
Quick Start
For Production (PrismaSelect)
Then use in your resolvers:
See the Plugins documentation for full details.
For Learning (Generator)
Add to your Prisma schema:
Create paljs.config.ts:
Generate with prisma generate.
See the Generator documentation for full details.
Package Overview
| Package | Use Case | Badge |
|---|---|---|
| @paljs/plugins | Production applications | Production Ready |
| @paljs/generator | Learning, prototyping | Learning |
| @paljs/nexus | Learning Nexus + Prisma | Learning |
| @paljs/admin | Internal tools, admin panels | Internal Tools |
Next Steps
- PrismaSelect (Production) — Start here for production apps
- Generator (Learning) — Quick scaffolding for learning
- Configuration — Learn all
defineConfig()options - Upgrade Guide — Migrating from v8 to v9