Code Monkey home page Code Monkey logo

aws-appsync-js's Introduction

aws-appsync-js

Description

Pure js client for AWS AppSync. AWS AppSync

Welcome! AWS AppSync is a managed GraphQL service that allows web and mobile developers to create powerful data driven applications on top of AWS. Follow these steps to deploy a GraphQL API and integrate it into your application.

Design your schema

Navigate to the Schema page and design your schema using the GraphQL schema definition language (SDL). Use SDL to define the types, interfaces, and enums that define the shape of your API. Schema Reference

Add a data source

AWS AppSync runs on top of the AWS services you already know. Add an existing DynamoDB table via the Data Sources page or let us provision one for you with the Create Resources button on the Schema page. Data Source Reference

Connect data sources with a resolver

A resolver is attached to a field on an object type in your schema. The resolver executes an action against a data source whenever its field is listed in the selection set of a GraphQL query. Customize resolver behavior with mapping templates and use the full capabilities of Amazon DynamoDB, AWS Lambda, and Amazon Elasticsearch Service. Resolver Reference

Integrate your GraphQL API

Once you have deployed your API, easily add it to your application with one of our powerful SDKs or using popular tools such as Apollo Client and Relay.

Description is taken from AWS

Install

npm install aws-appsync-js --save
# or
yarn add aws-appsync-js

Usage

// ES6 modules
import AppSyncClient, { authMode } from 'aws-appsync-js';

// CommonJS modules
const AppSyncClient = require('aws-appsync-js').default;
const { authMode } = require('aws-appsync-js');

const appSyncClient = new AppSyncClient({
  auth: {
    mode: authMode.API_KEY_MODE,
    apiKey: 'your_app_sync_API_KEY',
    apiUrl: 'your_app_sync_API_URL',
  }
});

const query = `
  query {
    eventList {
      description
      name
    }
  }
`;

appSyncClient.request(query)
  .then(({ data: { eventList }) => {
    // do something with your data
    console.log(eventList);
  });

appSyncClient.introspect()
  .then(({ data }) => {
    // you can see your schema data
    console.log(data);
  })

Contribution

Technology is in development. It is planned to create independent client for using AWS AppSync without any strong links to any technologies. You are welcome to submit your ideas and comments using issues.

aws-appsync-js's People

Contributors

vlewin avatar

Watchers

 avatar  avatar

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.