Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature requests for JS utility functions #19

Open
simonrw opened this issue Feb 8, 2024 · 1 comment
Open

Feature requests for JS utility functions #19

simonrw opened this issue Feb 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@simonrw
Copy link
Collaborator

simonrw commented Feb 8, 2024

Motivation

We do not currently support the whole of the AppSync @aws-appsync/utils package available on AWS. We would like some input on what functions are the most used by our community.

Instructions

Please add a comment to this PR indicating which functions you use when using AppSync, specifically in JavaScript resolvers from the @aws-appsync/utils package. If a comment already exists with your suggestion then please leave a 👍 on the comment, and we will use this to prioritise the functions that are most requested.

Currently implemented functions

Assuming the following import:

import { util } from '@aws-appsync/utils'
  • util.autoId
  • util.appendError (partial, the function exists but errors are not yet captured)
  • util.time.nowFormatted
  • util.transform.toDynamoDBFilterExpression
  • util.transform.toDynamoDBConditionExpression
  • util.dynamodb.toDynamoDB
  • util.dynamodb.toString
  • util.dynamodb.toStringSet
  • util.dynamodb.toNumber
  • util.dynamodb.toNumberSet
  • util.dynamodb.toBinary
  • util.dynamodb.toBinarySet
  • util.dynamodb.toBoolean
  • util.dynamodb.toNull
  • util.dynamodb.toList
  • util.dynamodb.toMap
  • util.dynamodb.toMapValues
  • util.dynamodb.toS3Object
  • util.dynamodb.fromS3ObjectJson

Assuming the following import:

import * as rds from '@aws-appsync/utils/rds'
  • rds.createMySQLStatement
  • rds.createPgStatement
  • rds.insert
  • rds.remove
  • rds.select
  • rds.toJsonObject
  • rds.typeHint.DECIMAL
  • rds.typeHint.JSON
  • rds.typeHint.TIME
  • rds.typeHint.DATE
  • rds.typeHint.UUID
  • rds.typeHint.TIMESTAMP
  • rds.update

Assuming the following import:

import * as dynamodb from '@aws-appsync/utils/dynamodb'
  • dynamodb.get
  • dynamodb.operations.add
  • dynamodb.operations.append
  • dynamodb.operations.decrement
  • dynamodb.operations.increment
  • dynamodb.operations.prepend
  • dynamodb.operations.replace
  • dynamodb.put
  • dynamodb.remove
  • dynamodb.scan
  • dynamodb.update
@simonrw simonrw pinned this issue Feb 8, 2024
simonrw added a commit that referenced this issue Feb 8, 2024
# Motivation

We should be transparent about which functions are covered and which
aren't. This helps our users understand our current status, and indicate
that we are not 100% complete with our implementation.

To aid with this process, I have created
#19 which lists the
functions we support, and encourage users to list/upvote their
suggestions.
In turn, to support this I have added a script to capture the functions
we implement, and to print them out to the console. We may automate this
procedure in the process if it gets too arduous.

The example output from this script can be seen in the ["Currently
implemented
functions"](https://github.com/localstack/appsync-utils/issues/19#user-content-#currently-implemented-functions)
section of the linked issue.

# Changes

* Add script to capture feature coverage by introspecting the utilities
library.
* Fix a relative import issue when using the script
@simonrw simonrw added the enhancement New feature or request label Feb 8, 2024
@johannesfloriangeiger
Copy link

johannesfloriangeiger commented Feb 13, 2024

import { runtime } from '@aws-appsync/utils';
  • runtime.earlyReturn

(https://docs.aws.amazon.com/appsync/latest/devguide/runtime-utils-js.html)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants