aws / aws/aws-appsync-community

Support more compact auto IDs (e.g. nanoID)

Open
#244 0 comments 3 reactions 0 assignees View on GitHub
feature-request
Dominant language
HTML
Stars
507
Forks
37
PR merge metrics
No merged PRs in 30d

Description

We're auto-creating our VTL templates via Amplify graphql-transform. Amplify uses `$util.autoId()` when creating new entities ([doc](https://docs.aws.amazon.com/appsync/latest/devguide/utility-helpers-in-util.html)).

This leads to UUIDs like `4aedfa04-9da8-484a-ae9c-a4c72b9508ff`. Yet, we would prefer more compact IDs like nano IDs (e.g. `Lw-4jMp9u32VHUgb7aPDU`) because they use less storage space and are more suitable for URLs.

Is there a way to change the ID generator in Amplify graphql-transform? If not, can we somehow add our own ID generator to VTL similar to `$util.autoId()`.

The only option we can see so far is using Lambda functions for entity creation but this would add lots of complexity (we need to maintain many new Lambda functions) and be more expensive (VTL vs Lambda execution).

Contributor guide

Open the contributing guide

Research direction

Start with the Amplify graphql-transform entry point and the AppSync $util.autoId() behavior described in the linked utility-helpers documentation. Determine whether the ID generator can be configured or extended for VTL, and document a supported compact-ID path or confirm that entity creation requires Lambda.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, graphql
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.