GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - localstack/appsync-utils: Implementation of AppSync JavaScript utilities

BranchesTags
Open more actions menu

Latest commit

 

History

371 Commits
371 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
__tests__
__tests__
 
 
cdk
cdk
 
 
dynamodb
dynamodb
 
 
rds
rds
 
 
scripts
scripts
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
README.md
README.md
 
 
dynamodb-utils.js
dynamodb-utils.js
 
 
errors.js
errors.js
 
 
index.js
index.js
 
 
jest.config.js
jest.config.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
test_in_docker.sh
test_in_docker.sh
 
 

Repository files navigation

AppSync Javascript resolver implementation

This package provides an implementation for the @aws-appsync/utils package that is available on AWS.

Changelog:

  • v0.1.9: add runtime.earlyReturn(), importable from @aws-appsync/utils; it validates the skipTo return option and hands the value and target to the host, which decides which handlers still run
  • v0.1.8: util.authType() now reports Lambda Authorization for the identity of a Lambda-authorized Event API request, which carries what the authorizer returned as handlerContext rather than the resolverContext a GraphQL API uses
  • v0.1.7: complete the @aws-appsync/utils/dynamodb module with query, sync, the batch and transact helpers, the set helpers, operations.remove and operations.updateListItem, and the arguments the existing helpers dropped (filter, projection, condition, consistentRead, _version and the rest); add util.transform.toSubscriptionFilter; util.dynamodb.fromS3ObjectJson now parses instead of throwing
  • v0.1.6: add util.authType(), derived from the identity of the request; a host installs the request through the new setResolverContext export. util.transform.toDynamoDBFilterExpression and toDynamoDBConditionExpression now cover every operator, including between, in, size and attributeType, and nested and/or/not; util.dynamodb.toDynamoDB accepts null
  • v0.1.5: add rds beginsWith, between and size conditions, table aliases and sql template where clauses; invalid input now raises AWS's validation error instead of a raw TypeError, and the wildcard conditions require a string
  • v0.1.4: fix rds query builders with empty orderBy, where and values inputs, contains wildcards and multiple conditions per column; orderBy dir is now restricted to ASC/DESC
  • v0.1.3: fix rds query builders with star columns, empty where objects and nullable limit/offset
  • v0.1.2: fix rds query builders with schema qualified identifiers
  • v0.1.1: security updates
  • v0.1.0: first pinned version of the library

Tip

To ensure you are using the latest version of this package with LocalStack, start LocalStack with the environment variable

APPSYNC_JS_LIBS_VERSION=refresh localstack start

This will fetch the latest version the first time a JavaScript resolver is executed. On next startup this flag is not needed unless the package needs to be updated.

Alternatively the library can be pinned to a specific Git tag or commit by setting: APPSYNC_JS_LIBS_VERSION=<commit or tag>

Requesting functions to be implemented

We do not yet cover all functionality as provided by AWS AppSync. To request missing functions, or to see our function coverage, please see #19.

Development workflow

The test suite has automatic comparison with AWS. The testing workflow looks like:

  • Add the test to __tests__/index.test.js passing the string text of the utility you wish to test, for example
test("string", async () => {
  await checkValid(`util.dynamodb.toDynamoDB("test")`);
});
  • Run the test against AWS to capture the snapshot:
npm run test:aws
  • Run the tests against the local package, using the snapshot for the ground truth
npm run test

About

Implementation of AppSync JavaScript utilities

Resources

Readme

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

9 stars

Watchers

13 watching

Forks

1 fork
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.