Socket
Socket
Sign inDemoInstall

@crft/appsync-gateway

Package Overview
Dependencies
44
Maintainers
7
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "@crft/appsync-gateway",
"version": "1.0.6",
"version": "1.0.7",
"description": "Utility method for making API calls to AppSync from Lambdas in AWS.",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

@@ -5,11 +5,31 @@ # Appsync API Gateway

This library essentially implements the suggested approach outlined by [AWS Amplify Docs](https://docs.amplify.aws/lib/graphqlapi/graphql-from-nodejs/q/platform/js) in a nice package.
## Usage
Install via NPM:
```
npm i @crft/appsync-gateway --save
```
then use like:
```ts
const {
GraphQLGateway,
IAMCredentialsStrategy
IAMCredentialsStrategy,
APIKeyCredentialsStrategy,
AuthHeaderCredentialsStrategy
} = require('@crft/appsync-gateway');
// IAM Mode
const creds = new IAMCredentialsStrategy();
// API Key Mode
const creds = new APIKeyCredentialsStrategy(API_KEY);
// Auth Headers Mode
const creds = new AuthHeaderCredentialsStrategy(authHeader);
const gateway = new GraphQLGateway(

@@ -19,5 +39,23 @@ creds,

);
const myQuery = `
query ListTodosOperation {
listTodos {
items {
title
}
}
}
`;
await gateway.runQuery({
operationName: 'ListTodosOperation',
query: myQuery,
variables: {
input: {}
}
});
```
## Commands
- `npm build` - Run the typescript build
- `npm build` - Run the typescript build
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc