Debug confusion in prisma tutorial

prisma

#1

I’m following along in this prisma tutorial and I’m seeing the sample code and repo code differ. If you look at the number 3 arrow, you’ll see:

const server = new GraphQLServer({
  typeDefs: './src/schema.graphql',
  resolvers,
  context: req => ({
    ...req,
    db: new Prisma({
      typeDefs: 'src/generated/prisma.graphql',
      endpoint: 'https://eu1.prisma.sh/jane-doe/subscriptions-example/dev',
      secret: 'mysecret123',
      debug: true,
    }),
  }),
})

but the debug in the repo code looks like:

context: req => ({
  ...req,
  db: new Prisma({
    typeDefs: 'src/generated/prisma.graphql',
    endpoint: 'https://us1.prisma.sh/subscriptions-demo-db/dev',
    secret: 'mysecret123',
  }),
  debug: true,
}),

Which one is correct?


#2

debug is a property for the Prisma constructor of prisma-binding.
Hence, the first version is correct.
Could you provide a PR to the example code? :slight_smile:


#3

gotcha, good to know! It’s weird, the source file is correct but when I run the command in the tutorial:

curl https://codeload.github.com/nikolasburk/subscriptions/tar.gz/starter | tar -xz subscriptions-starter

I’m getting what seems like an older version.


#4

Try

curl -LOJ https://codeload.github.com/nikolasburk/subscriptions/zip/master && unzip subscriptions-master.zip

instead.