Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use serverless framework #760

Open
kokokenada opened this issue Apr 28, 2020 · 3 comments
Open

Use serverless framework #760

kokokenada opened this issue Apr 28, 2020 · 3 comments
Labels
needs/discussion Open-ended conversation about something (ideation, design, analysis, ...) scope/server Related to the server component type/feat Add a new capability or enhance an existing one

Comments

@kokokenada
Copy link

Perceived Problem

Lots options for deployment each having their own configuration. Users want out of the box magic for whatever target environment.

Ideas / Proposed Solution(s)

Give users a lot of choices to deploy to a variety of targets by using the open source parts of the serverless framework. The community can develop templates/starters.

Create standard approach to dev/staging/prod CICD pipeline.

Kind of an unformed idea here, but I thought I'd pass it on having used the serverless framework in a recent project and thought it was pretty good.

@kokokenada kokokenada added the type/feat Add a new capability or enhance an existing one label Apr 28, 2020
@jasonkuhrt jasonkuhrt added scope/server Related to the server component needs/discussion Open-ended conversation about something (ideation, design, analysis, ...) labels May 3, 2020
@jasonkuhrt
Copy link
Member

I think we can explore this better once we have #782.

@jasonkuhrt
Copy link
Member

@leungandrew
Copy link

leungandrew commented Jun 22, 2020

I'm super interested in getting a Nexus + Prisma app to run in the above deploying to Serverless Express. I've made enough progress to the point where I have the Playground and GraphQL endpoints working (which imply that the express server is running properly).

Some minor tweaks I had to make from the scaffolded app produced via npx nexus are to move the app.js file to the rootDir, update tsconfig to compile from the rootDir ., and in app.js the following:

import app, { server, use } from 'nexus'
import { prisma } from 'nexus-plugin-prisma'

use(prisma({ features: { crud: true } }))

require('./api/graphql')
app.assemble()

module.exports = server.express

The module.exports is required by the express serverless component as it expects the the app.js to export the express server. (And also that the app.js lives at the rootDir or it won't find the express app).

The last issue I'm running into seems to be Prisma specific however, as for some reason, even though I've set the binaryTarget for Prisma when running on AWS Lambda to be
rhel-openssl-1.0.x, I get the following error:

"\nInvalid `prisma.user.findMany()` invocation in\n/var/task/node_modules/nexus-prisma/dist/builder.js:202:93\n\n\n  EROFS: read-only file system, chmod '/var/task/node_modules/.prisma/client/query-engine-rhel-openssl-1.0.x'"

I wonder if it has anything to do with https://github.com/prisma/prisma-client-js/issues/476, however that implies it's a Windows issue, whereas I'm deploying via macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/discussion Open-ended conversation about something (ideation, design, analysis, ...) scope/server Related to the server component type/feat Add a new capability or enhance an existing one
Projects
None yet
Development

No branches or pull requests

3 participants