Registry / devops / prisma-appsync

prisma-appsync

JSON →
library1.0.2jsnpmunverified

Prisma-AppSync transforms your Prisma schema into a fully-featured GraphQL API tailored for AWS AppSync. Version 1.0.2 (latest) provides auto-generated CRUD operations, TypeScript client for Lambda resolvers, pre-configured security (XSS protection, query depth limiting, rate limiting), and flexible authorization (API keys, IAM, Cognito). Released under MIT license. Differentiator: deep integration with Prisma and AppSync, unlike generic GraphQL-to-DynamoDB tools.

npm install prisma-appsync
INSTALL
IMPORT
SIG · PRISMA-APPSYNC
P
prisma-appsync
devopsjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

AppSyncClient
import { AppSyncClient } from 'prisma-appsync'
import AppSyncClient from 'prisma-appsync'
Named export; no default export.
createSchema
import { createSchema } from 'prisma-appsync'
const { createSchema } = require('prisma-appsync')
ESM-only; CommonJS require will fail with errors importing ESM.
AuthMode
import type { AuthMode } from 'prisma-appsync'
TypeScript type; available for strong typing.

Shows how to initialize Prisma-AppSync client, create a schema from Prisma client, and deploy to AWS AppSync.

import { PrismaClient } from '@prisma/client'; import { AppSyncClient, createSchema } from 'prisma-appsync'; const prisma = new PrismaClient(); const schema = createSchema({ prisma, auth: { mode: 'API_KEY' }, options: { queryDepthLimit: 6 } }); const appSyncClient = new AppSyncClient({ region: 'us-east-1', schema, apiKey: process.env.APPSYNC_API_KEY ?? '' }); async function main() { await appSyncClient.deploy(); console.log('API deployed successfully'); } main().catch(console.error);
Debug
Known issues
gotchaRequires Node >=14; does not support Node <=12 or earlier.
fix
Upgrade Node.js to version 14 or later.
affects: <1.0.0
breakingBreaking change: v1.0.0 dropped support for CommonJS; only ESM is supported.
fix
Use import syntax instead of require(). Ensure package.json has 'type': 'module' or use .mjs extension.
affects: >=1.0.0
deprecatedThe 'auth' option in createSchema changed from 'mode' to 'authorization' in v1.0.0.
fix
Use { authorization: { mode: 'API_KEY' } } instead of { auth: { mode: 'API_KEY' } }.
affects: <1.0.0
gotchaAppSyncClient constructor expects 'schema' as object (not string).
fix
Pass the result of createSchema() directly; do not serialize.
affects: >=1.0.0
gotchaDeploying may overwrite existing AppSync API; check region and API name to avoid accidental overwrites.
fix
Set a unique API name or use 'update' mode if supported.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prisma-appsync'
Package not installed or wrong import path.
fix
npm install prisma-appsync
SyntaxError: Cannot use import statement outside a module
Trying to use ESM in a CommonJS environment.
fix
Add 'type': 'module' to package.json or migrate to ESM.
TypeError: createSchema is not a function
Typo in function name or using default import when it's a named export.
fix
Use 'import { createSchema } from 'prisma-appsync''.
Error: Config validation error: 'auth' is not allowed
Using deprecated 'auth' option instead of 'authorization'.
fix
Replace 'auth' key with 'authorization'.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
prismarequiredRequired as peer dependency for schema generation and client
Agent activity
2 hits · last 30 days
node
2
Resources
prisma-appsync — npm install prisma-appsync · libregistry