aws-amplify / amplify-backend

Home to all tools related to Amplify's code-first DX (Gen 2) for building fullstack apps on AWS
Apache License 2.0
184 stars 62 forks source link

Option 2: Split out schema generation. #2169

Closed sobolk closed 5 days ago

sobolk commented 2 weeks ago

This is a (preferred?) alternative to https://github.com/aws-amplify/amplify-backend/pull/2167 .

The idea here is to split out schema computations from data construct creation. So that schema computation can become both input to function and data construct.

Elements:

  1. Split schema generation logic.
  2. Add new concept in construct container to register provider/factory method that can provide arbitrary piece of data.

The upside of this solution is that schema is can be bundling time asset without network calls from lambda.

The downside (if this is a downside at all?) is that we're inventing new way of how verticals can communicate and construct container becomes closer to be generic DI container (like syringe) where modules may register arbitrary logic. (which can be abused if contract between verticals established this way is not guarded with proper types/interfaces which become public api of a vertical).

changeset-bot[bot] commented 1 week ago

🦋 Changeset detected

Latest commit: d900a82c7fa14f12e6371cb9b2bae781eb157fcc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | -------------------------- | ----- | | @aws-amplify/ai-constructs | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR