5028a44eb655e101dd25720970f9dfd8.svg        Lieferung und Bezahlung      Alles über dem Einkauf      Blog      Aktuell

Appsync Unified Repo Official

In packages/web/package.json :

Try the official @aws-solutions-constructs/aws-appsync-dynamodb pattern inside a monorepo, or explore graphql-mesh for federation-like patterns. Do you run AppSync in a monorepo? What has been your biggest challenge? Let me know in the comments.

If you have ever worked on a project with multiple frontends (React, iOS, Android) talking to a single GraphQL API, you know the pain: Schema drift, duplicated resolver logic, and the "it works on my machine" syndrome for GraphQL transformations. appsync unified repo

// Attach a resolver using the new JS runtime postDS.createResolver('getPostResolver', { typeName: 'Query', fieldName: 'getPost', code: appsync.Code.fromAsset('graphql/resolvers/getPost.js'), runtime: appsync.FunctionRuntime.JS_1_0_0, }); In a unified repo, you can write resolvers in TypeScript and transpile them to the AppSync JS runtime. Store resolvers as .ts files and build them to resolvers/ during deployment.

Start with a simple two-package structure ( api + one client), then expand. The tooling (CDK, GraphQL Codegen, npm workspaces) is mature enough for production today. In packages/web/package

Example resolver ( getPost.ts ):

Taming the GraphQL Beast: Managing AWS AppSync in a Unified Repository Let me know in the comments

export function response(ctx: any) { return ctx.result; }

How to share schemas, resolvers, and logic across multiple frontends without losing your mind.

my-appsync-monorepo/ ├── packages/ │ ├── api/ # AppSync backend definition (CDK or Terraform) │ │ ├── graphql/ │ │ │ ├── schema.graphql │ │ │ └── resolvers/ │ │ │ ├── getPost.js # JS resolvers (AppSync JS runtime) │ │ │ └── listPosts.vtl # or legacy VTL │ │ ├── lib/ │ │ │ └── datasources.ts # DynamoDB, Lambda, HTTP │ │ └── bin/ deploy.ts # CDK stack │ ├── web/ # React/Vue frontend │ │ ├── src/ │ │ └── codegen.yml # GraphQL Code Generator config │ ├── mobile/ # React Native / iOS │ └── shared/ # Common types & validation logic └── scripts/ └── codegen-all.sh # Trigger codegen for all clients Use the AWS Cloud Development Kit (CDK) or Amplify (with CDK under the hood) to define your AppSync API inside packages/api .

Geschwindigkeit der Lieferung
Qualität der Kommunikation
Übersichtlichkeit des E-Shops
91 %
Unsere Kunden waren mit dem Kauf zufrieden www.secutek24.de
30 Bewertung