AppSync

    Basic support for AppSync is included in LocalStack Pro. The local AppSync API allows you to spin up local GraphQL APIs and directly expose your data sources (e.g., DynamoDB tables) to external clients.

    For example, you can create a DynamoDB table with a key attribute id, and define a GraphQL schema in a file schema.graphql like this:

    1. a GraphQL API
    2. a request mapping template with a content like this:

    Once things have been wired up properly, and assuming the ID of your GraphQL API is , you should be able to run the following GraphQL query to retrieve all items from the "posts" DynamoDB table:

    For more details, please refer to the self-contained sample published in this Github repository.

    GraphQL Endpoints

    There are three configurable strategies that govern how GraphQL API endpoints are created. The strategy can be configured via the GRAPHQL_ENDPOINT_STRATEGY environment variable.