Has anybody deployed Prisma 1.8 to Fargate using t...
# orm-help
h
n
Hey, you can also follow the tutorial in the properly rendered version here: https://www.prisma.io/docs/tutorials/deploy-prisma-servers/aws-fargate-joofei3ahd
Did you encounter any issues with the tutorial?
s
I was able to do it successfully. what kinds of issues did you run into?
n
Was just curious if everything works because I updated the tutorial just yesterday 🙌
s
@nikolasburk I noticed that. thanks for doing that!
a colleague & I were having trouble with an outdated version of the tutorial
h
@Sam Hulick -- I was having issue with an outdated tutorial, as well, but @nilan pointed me in the right direction this AM. Since then, @nikolasburk, I have it up and running,.... but do have questions. It looks like the templates auto-generate a GraphQL API based on my database schema. However, I have a different
schema.graphql
to use for building the API, and a nodejs application that will serve it with a series of custom resolvers. Is there a way to roll that into all of this?
n
You mean you basicallt want to merge your
schema.graphql
with your
prisma.graphql
?
h
well... maybe? the way the local dev environment is running, is that we have an entry for our node application, which spins up express and creates our api
Copy code
import { GraphQLServer, Options } from 'graphql-yoga'
import { Prisma } from 'prisma-binding'
import { resolvers } from './resolvers'
import { formatError } from 'apollo-errors'

const serverOptions: Options = {
  formatError,
}

const server = new GraphQLServer({
  typeDefs: './schema/schema.graphql',
  resolvers,
  context: (req) => ({
    ...req,
    db: new Prisma({
      typeDefs: 'generated/prisma.graphql',
      endpoint: '<http://localhost:4466/services/dev>',
      secret: 'ufggvyutfgt',
      debug: true,
    }),
  }),
})

server.start(serverOptions, () =>
  console.log(`Server is running on <http://localhost:4000`>),
)
now... what I am wondering is if we can still deploy this separately to EC2...
but have that endpoint be the prisma URL that we just created with fargate?
right now, that
localhost:4466/services/dev
represents our locally running prisma container
my gut says that should work, but i'm fairly new to prisma and want to keep to best practices instead of hacking away
n
yes, it should work.
note that you need to make sure that the generated files are re-generated for the new endpoint
as the API could be different