Appsync Unified Repo -

You can start with a single API in the unified repo and gradually pull in other services. Existing standalone AppSync APIs can be imported as subgraphs.

Just because everything is in one repo does not mean everything must be one CDK stack. Use stack dependencies or nested stacks:

Your stack file unifies everything:

// packages/api/lib/api-stack.ts
export class ApiStack extends Stack 
  public readonly graphqlUrl: string;
  public readonly apiId: string;

constructor(scope: Construct, id: string, props: ApiStackProps) super(scope, id, props); appsync unified repo

const api = new GraphqlApi(this, 'UnifiedApi', 
  name: 'UnifiedRepoApi',
  schema: Schema.fromAsset(path.join(__dirname, 'schema.graphql')),
  authorizationConfig:  defaultAuthorization: ... ,
);
// Inline resolvers (stored as assets)
api.createResolver('QueryGetPostJS', 
  typeName: 'Query',
  fieldName: 'getPost',
  code: Code.fromAsset(path.join(__dirname, 'resolvers/Query.getPost.js')),
  runtime: FunctionRuntime.JS_1_0_0,
);
this.graphqlUrl = api.graphqlUrl;
this.apiId = api.apiId;

Use a unified repo when:

async batchCreate(inputs: TCreateInput[]): Promise<T[]> 
  const promises = inputs.map(input => this.create(input));
  return Promise.all(promises);

Use @graphql-codegen/cli to generate TypeScript types for your Lambda resolvers:

// packages/data-sources/src/types/graphql.ts generated from schema.graphql
export type QueryGetPostArgs =  id: string ;
export type Post =  id: string; title: string; content: string ;

// Now your Lambda is fully typed import type QueryGetPostArgs, Post from './types/graphql';

export const handler = async (event: AppSyncResolverEvent<QueryGetPostArgs>): Promise<Post> => const id = event.arguments; // Your logic here... ; You can start with a single API in

No more manual type updates when the schema changes. Run yarn generate and the unified repo syncs everything.