Hello everyone :slightly_smiling_face: Did someone...
# orm-help
m
Hello everyone 🙂 Did someone make Apollo Server with Prisma and Postgres database ?
j
Hello ! I did it’s pretty straightforward
Copy code
const db = new Prisma({
  typeDefs: "src/generated/prisma.graphql",
  endpoint: "<https://eu1.prisma.sh/xxxx/s10d-prisma/dev>",
  debug: true,
  // secret: process.env.PRISMA_SECRET
});

const typeDefs = importSchema(path.resolve(__dirname, "schema.graphql"));

const schema = makeExecutableSchema({
  typeDefs,
  resolvers: {
    //...
  }
});

const params = {
  schema,
  introspection: true,
  context: req => ({
    ...req,
    db
  })
};

const server = new ApolloServer(params);
server.listen().then(({ url }) => {
  console.log(`🚀  Server ready at ${url}`);
});
m
How do you like it ? Using it for larger application or just small one ?
j
it’s a prototype for now but aims at being relatively large. I’ve read that yoga is more or less deprecated now that apollo server 2 is here since it superseeds it, so I guess apollo server is the way to go now.
f
I’m using this for medium sized apps and it’s working quite well. You have an example of apollo-server with prisma here: https://github.com/frandiox/vue-graphql-enterprise-boilerplate/tree/master/server/src
m
Cool thank you guys. Yh saw about yoga.. Didnt play to use it anyway..