zak.singh
07/27/2018, 11:33 PMMike
07/27/2018, 11:35 PMusersConnection relies on data written into the _RelayId table. Unless you really really really need to, I recommend avoiding direct writes to any Prisma-backed DBMike
07/27/2018, 11:38 PMprisma-binding in my lambda functions just like I do in my resolvers. There are certain operations that Prisma can’t do efficiently yet, but it’s pretty good at writes. I can definitely see you wanting to do direct reads though for some of that sweet sweet fulltext search efficiency.zak.singh
07/27/2018, 11:39 PMMike
07/27/2018, 11:41 PMzak.singh
07/27/2018, 11:44 PMMike
07/27/2018, 11:46 PMrimraf dist && tsc
That builds everything into dist (also from the boilerplate)
And then I use sls deploy to handle packaging and deploying those pre-compiled files to my lambdasMike
07/27/2018, 11:47 PMzak.singh
07/27/2018, 11:51 PMconst prisma = new Prisma({
typeDefs: 'schemas/database.graphql',
endpoint: '<https://us1.prisma.sh/demo/my-service/dev>',
secret: 'my-super-secret-secret'
})zak.singh
07/27/2018, 11:52 PMMike
07/27/2018, 11:52 PMsrc/generated/prisma.tsMike
07/27/2018, 11:54 PMMike
07/27/2018, 11:56 PMconst typeDefs = `
...insanely long string...
`;Mike
07/27/2018, 11:56 PMMike
07/27/2018, 11:59 PMzak.singh
07/28/2018, 6:36 AMMike
08/01/2018, 4:34 PMsrc/serverless/subscriptions/fooBar/handler.ts
src/serverless/subscriptions/fooBar/query.graphql
Then I build with yarn build
and I deploy with sls deploy (serverless framework).
My serverless.yml looks like:
custom:
subsDir: dist/serverless/subscriptions
functions:
fooBar:
handler: ${self:custom.subsDir}/fooBar/handler.default
events:
- http:
path: fooBar
method: post