Hi, I'm trying to get prisma 3.14 running with mon...
# orm-help
m
Hi, I'm trying to get prisma 3.14 running with mongodb, nexus-plugin-prisma and graphql-yoga. The docs (https://www.prisma.io/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-prisma-binding-to-nexus) point to the old version of graphql-yoga, v2 is available via
yarn add @graphql-yoga/node
. If I migrate to graphql-yoga v2 I get the error that nexus is needed, but this breaks nexus-plugin-prisma. Could someone please help me ? 😉 This is my index.ts:
Copy code
require("dotenv").config();
import { PrismaClient } from "@prisma/client";
import * as path from "path";
import { nexusSchemaPrisma } from "nexus-plugin-prisma/schema";
import { makeSchema } from "@nexus/schema";
import { createServer } from "@graphql-yoga/node";
import { checkEnv } from "./src/utils";
import { getClaims } from "./src/auth";
import config from "./config";
import { Query, Mutation } from "./src/types";

checkEnv(config.requieredEnvs);

const schema = makeSchema({
  types: [Query, Mutation],

  plugins: [
    nexusSchemaPrisma({
      experimentalCRUD: true,
    }),
  ],

  outputs: {
    schema: path.join(__dirname, "./src/generated/schema.graphql"),
    typegen: path.join(__dirname, "./src/generated/nexus.ts"),
  },
});

const serverOptions = {
  port: process.env.MAIL_PORT || 4000,
};

const server = createServer({
  schema,
  context: async (req) => {
    return {
      ...req,
      PrismaClient,
      claims: await getClaims(req),
      options: serverOptions,
    };
  },
});

server.start();
console.log(`🚀  Server is running on <http://localhost>:${serverOptions.port}`);
n
Instead of garphql-yoga can you have a look at paljs.com?