is there a simple way to set up prisma-binding in ...
# orm-help
r
is there a simple way to set up prisma-binding in a lambda function for some scheduled events? It used to be pretty easy to that with graphcool-lib but it seems prisma-binding expects parts such as a graphl schema etc. I would just want to have access to my prisma cloud endpoint.
m
Hi! To accomplish this, I just run express/apollo-server behind a lambda function. This is my handler file: const awsServerlessExpress = require("aws-serverless-express"); const { app } = require("./src/server"); const server = awsServerlessExpress.createServer(app); module.exports.handler = (event, context) => { console.log(JSON.stringify(event)); return awsServerlessExpress.proxy(server, event, context); };
r
Thanks for the reply! Isnt this a bit overkill though? I just need to write some data to my endpoint so not sure if I need a graphql server for that
m
If I’m in a backend function and need to update my db, I usually just use ‘request’ and post the query string to my backend ‘by hand’