Appsync Unified Repo -

import { util } from '@aws-appsync/utils'; import { get } from 'aws-appsync-resolver-helpers'; // your own helpers export function request(ctx: any) { return { operation: 'GetItem', key: util.dynamodb.toMapValues({ id: ctx.args.id }), }; }

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

// packages/api/lib/appsync-stack.ts import * as appsync from 'aws-cdk-lib/aws-appsync'; import * as dynamodb from 'aws-cdk-lib/aws-dynamodb'; const api = new appsync.GraphqlApi(this, 'MyUnifiedApi', { name: 'UnifiedBlogApi', schema: appsync.Schema.fromAsset('graphql/schema.graphql'), // single source of truth });

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. appsync unified repo

// DynamoDB datasource const postTable = new dynamodb.Table(...); const postDS = api.addDynamoDbDataSource('PostDS', postTable);

Example resolver ( getPost.ts ):

In packages/web/package.json :

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

Taming the GraphQL Beast: Managing AWS AppSync in a Unified Repository

{ "scripts": { "codegen": "graphql-codegen --config codegen.yml", "build": "npm run codegen && vite build" } } The codegen.yml points to the local schema file: import { util } from '@aws-appsync/utils'; import {

// 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.

Enter the (monorepo). By managing your AWS AppSync configuration—schema, resolvers (VTL or JavaScript), datasources, and even client code—in a single repository, you can enforce consistency, improve developer experience, and streamline CI/CD.