2.16.0 • Published 1 year ago

appsync-client v2.16.0

Weekly downloads
52
License
MIT
Repository
github
Last release
1 year ago

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
2.16.0

1 year ago

2.15.0

2 years ago

2.14.0

2 years ago

2.13.0

2 years ago

2.12.0

2 years ago

2.11.0

2 years ago

2.10.0

3 years ago

2.9.0

3 years ago

2.8.0

3 years ago

2.7.0

3 years ago

2.5.0

3 years ago

2.4.0

3 years ago

2.6.0

3 years ago

2.3.0

3 years ago

2.2.0

3 years ago

2.1.0

3 years ago

1.10.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.7.0

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago