Skip to content

A demonstration of integrating AWS AppSync with Cognito for authentication, and using client libraries such as Apollo and Amplify for querying GraphQL endpoints.

Notifications You must be signed in to change notification settings

razorRun/appsync-cognito-apollo-amplify-test

Repository files navigation


AppSync with Cognito, Apollo, and Amplify Test

This repository demonstrates how to integrate AWS AppSync with Cognito for authentication, and use client libraries such as Apollo and Amplify for querying the GraphQL endpoints.

Description

This project contains examples of how to interact with AWS AppSync using different approaches:

  1. Using Amplify by itself.
  2. Using Apollo with the Cognito ID.
  3. Using Amplify for querying AppSync, but with Cognito ID for authentication.

Setup

Pre-requisites

Ensure you have Node.js installed on your machine.

Installation

  1. Clone this repository:

    git clone https://github.com/razorRun/appsync-cognito-apollo-amplify-test
    cd appsync-cognito-apollo-amplify-test
  2. Install dependencies:

    npm install

Usage

There are three scripts you can run, each representing one of the three approaches:

  1. Using Amplify by itself:

    npm run start-amplify
  2. Using Apollo with the Cognito ID:

    npm run start-apollo
  3. Using Amplify for querying AppSync, but with Cognito ID for authentication:

    npm run start-ca

Key Points

  • Ensure you've set up your AWS AppSync and Cognito correctly for these scripts to function.
  • Never hardcode sensitive credentials directly in your scripts. It's recommended to use environment variables or AWS Secrets Manager.
  • These scripts are meant for demonstration and might need adjustments based on your actual AppSync and Cognito configurations.

Dependencies

Author

  • Roshan Milinda

License

  • MIT

About

A demonstration of integrating AWS AppSync with Cognito for authentication, and using client libraries such as Apollo and Amplify for querying GraphQL endpoints.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published