appsync-local

Run and test AWS AppSync JavaScript resolvers locally

Get Started npm

Full AppSync Compatibility

Complete implementation of AppSync JavaScript resolver context, utilities, and runtime behavior.

Multiple Data Sources

Support for DynamoDB, Lambda, HTTP, RDS (PostgreSQL/MySQL), and NONE data sources.

Authentication

API Key, AWS Lambda, Cognito User Pools, OpenID Connect, and IAM authentication modes.

Pipeline Resolvers

Full support for pipeline resolvers with before/after mapping templates and function chains.

Validation

Built-in validation for GraphQL schemas, resolver coverage, and AppSync JavaScript compatibility.

TypeScript

Written in TypeScript with full type definitions for excellent IDE support.

Quick Start

# Install globally
npm install -g appsync-local-server

# Or use npx
npx appsync-local-server start

# With a config file
appsync-local start -c appsync-config.json

Example Configuration

{
  "schema": "schema.graphql",
  "port": 4000,
  "apiConfig": {
    "auth": [{ "type": "API_KEY", "key": "da2-local-api-key" }]
  },
  "dataSources": [
    { "name": "UsersTable", "type": "AMAZON_DYNAMODB", "config": { "tableName": "Users" } }
  ],
  "resolvers": [
    { "typeName": "Query", "fieldName": "getUser", "dataSource": "UsersTable", "code": "resolvers/getUser.js" }
  ]
}