Git Product home page Git Product logo

cdk-appsync's Introduction

TypeScript + CDK で理解する AppSync

  • TypeScript + AWS CDK で AppSync を理解するためのシンプルな学習用サンプルコード
  • 次の内容が含まれます
    • AppSync GraphQL API + Resolver + None Type Data Source の CDK での定義
    • 作成した GraphQL API を curl で呼び出す
    • 作成した GraphQL API を Node.js から呼び出す
    • 作成した GraphQL API を React アプリケーションから呼び出す
  • 解説記事はこちら: TypeScript + CDK で理解する AppSync: はじめの一歩

使い方

AppSync および関連リソースのデプロイは次のようなコマンドにて実行します

$ cd ./backend
$ yarn install
$ cdk deploy --outputs-file ../outputs.json

デプロイ成功後 GraphQL API の URL や API キーの情報が含まれた ./outputs.json が作成され、このファイルは API コールを行う際に利用されます。

  • curl で GraphQL API を呼び出す際には backend ディレクトリより ./src/etc/hello.sh を実行します
    • jq のインストールが必要です
  • Node.js から GraphQL API を呼び出す際には backend ディレクトリより ts-node ./src/etc/hello.ts を実行します
    • ts-node のインストールが必要です
  • React アプリケーション から GraphQL API を呼び出す際には frontend ディレクトリより yarn install && yarn start を実行しブラウザで http://localhost:3000 を開きます

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.