Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

appsync-client

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

appsync-client

A lightweight Appsync client that signs requests for you - designed to be run server-side (e.g. on Lambdas).

  • 2.16.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1K
decreased by-18.58%
Maintainers
1
Weekly downloads
 
Created
Source

Appsync Client

Built with
typescript version dependants license

A lightweight Appsync client that signs requests for you (using IAM permissions) - perfect for running on Lambdas or servers.

Queries are made using TypedDocumentNode which means that the variables and results will be automatically typed for you if using Typescript.

Use

import AppsyncClient from "appsync-client";

async function getTodo() {

    // Create a client
    const client = new AppsyncClient({
        // Required
        apiUrl: "https://xxx.appsync-api.xx-xxxx-x.amazonaws.com/graphql",
        // Optional - these will default to process.env values (e.g. the IAM
        // role of the Lambda)
        accessKeyId: "",
        secretAccessKey: "",
        sessionToken: ""
    });

    // Query for Todos
    const res = await client.request({
        // The typed document node query
        query: TypedDocumentNodeQuery,
        // Variables to replace (here we are replacing $id with "todoId")
        variables: {
            id: "todoId"
        }
    );
}

Checklist

CD FeatureProvided
Typescript
Linting (AirBnB + Prettier)
Unit tests (Jest)
100% test coverage
Github Continuous Deployment

Keywords

FAQs

Package last updated on 09 Jan 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc