Skip to content

Instantly share code, notes, and snippets.

View christopher-caldwell's full-sized avatar

Christopher Caldwell christopher-caldwell

View GitHub Profile
@christopher-caldwell
christopher-caldwell / lambdaHandler.ts
Created August 19, 2024 14:03
GraphQL Yoga in Lambda with DB connection
import { APIGatewayEvent, APIGatewayProxyResult, Context } from 'aws-lambda'
import { createYoga } from 'graphql-yoga'
import { getDb, dbSchema } from '@_models'
import { schema } from './schema'
import { ResolverContext } from './types'
import { NodePgDatabase } from 'drizzle-orm/node-postgres'
const yoga = createYoga<ResolverContext>({
schema,