Amplify CLI API Category Plugin

3.3.5 · active · verified Tue Apr 21

The `@aws-amplify/amplify-category-api` package is an internal plugin for the AWS Amplify Command Line Interface (CLI). It empowers developers to create, configure, and manage both GraphQL (AWS AppSync) and REST (Amazon API Gateway) API resources within their Amplify projects. It's not a library for direct programmatic consumption but rather a core component of the `amplify` CLI toolchain, which currently operates at major version `14.x.x` for the CLI itself. This specific plugin's latest stable version is `5.15.3`. The Amplify CLI maintains a frequent release cadence, often with minor updates and bug fixes for its various categories. Key differentiators include its declarative API modeling with GraphQL Schema Definition Language (SDL) and automatic CloudFormation generation, alongside capabilities for local mocking and team environment management.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates initializing an Amplify project, adding a GraphQL API using the CLI, and deploying it to the AWS cloud.

npx create-react-app my-amplify-app
cd my-amplify-app
amplify init # Follow prompts to initialize a new Amplify project

# Add a GraphQL API
amplify add api
  # Choose 'GraphQL'
  # Choose 'Authorize and configure with AWS IAM (recommended for multi-user apps)'
  # Choose 'Single object with fields (e.g., "Todo")' or 'Blank schema'
  # Edit schema.graphql if desired (e.g., add more @model types)

# Deploy the API to the cloud
amplify push # Confirm changes and deploy

view raw JSON →