-1

I am trying to create Apollo server + Lambda + primsa2

const server = new ApolloServer({
    typeDefs
    resolvers,
    playground: {
        endpoint: "/dev/graphql"
    }
})

But what I have from prisma2 schema is like

generator client {
  provider = "prisma-client-js"
  binaryTargets = ["native", "rhel-openssl-1.0.x"]
}

datasource db {
  provider = "mysql"
  url      = env("DATABASE_URL")
}

model menu {
  idmenu    Int         @default(autoincrement()) @id
  menu_name String      @default("")
  shop_menu shop_menu[]
}

DB is using mysql

My question is How do I create basic typeDefs automatically from the system? Should I create typeDef manually?

Lee
  • 333
  • 3
  • 7
  • 19

1 Answers1

1

You would need to create the typedefs yourself or if you're using Nexus you can create the required models and that generate the typedefs automatically.

Ryan
  • 5,229
  • 1
  • 20
  • 31