PJPalJS

Introduction

Welcome to PalJS - your comprehensive toolkit for building GraphQL APIs with Prisma.

Important: Choosing the Right Tool

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/include objects
  • 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
typescript
import { PrismaSelect } from '@paljs/plugins';
 
const resolvers = {
  Query: {
    users: async (_, args, { prisma }, info) => {
      const select = new PrismaSelect(info).value;
      return prisma.user.findMany({ ...args, ...select });
    },
  },
};

Learning & Prototyping: Code Generators

The generator packages help you learn Prisma + GraphQL patterns quickly:

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

Quick Start

For Production (PrismaSelect)

Then use in your resolvers:

typescript
import { PrismaSelect } from '@paljs/plugins';
 
// In your resolver
const select = new PrismaSelect(info).value;
return prisma.user.findMany({ ...args, ...select });

See the Plugins documentation for full details.

For Learning (Generator)

Add to your Prisma schema:

prisma
generator paljs {
  provider = "paljs-generator"
  output   = "./generated/paljs"
}

Create paljs.config.ts:

typescript
import { defineConfig } from '@paljs/generator/config';
 
export default defineConfig({
  generateGraphQL: true,
  generateTypes: true,
});

Generate with prisma generate.

See the Generator documentation for full details.

Package Overview

PackageUse CaseBadge
@paljs/pluginsProduction applicationsProduction Ready
@paljs/generatorLearning, prototypingLearning
@paljs/nexusLearning Nexus + PrismaLearning
@paljs/adminInternal tools, admin panelsInternal Tools

Next Steps

  1. PrismaSelect (Production) — Start here for production apps
  2. Generator (Learning) — Quick scaffolding for learning
  3. Configuration — Learn all defineConfig() options
  4. Upgrade Guide — Migrating from v8 to v9

Command Palette

Search for a command to run...