paljs / prisma-tools

Prisma tools to help you generate CRUD system for GraphQL servers
https://paljs.com
MIT License
683 stars 54 forks source link

Generate doesn't work using the example #164

Closed Blatty closed 3 years ago

Blatty commented 3 years ago

Hello,

First, thanks a lot for your hard work on these tools, they are very helpful!

I just tried to generate a CRUD system using pal g for the nexus-plugin-prisma but it looks like it's not working (I've been using the example):

// schema.prisma

datasource postgresql {
  url      = env("DATABASE_URL")
  provider = "postgresql"
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id        String   @id @default(cuid())
  email     String   @unique
  birthDate DateTime
  posts     Post[]
}

model Post {
  id     String @id @default(cuid())
  author User[]
}
// pal.js
module.exports = {
  backend: {
    generator: 'nexus-plugin-prisma',
  },
};
$ Prisma Schema loaded from prisma/schema.prisma
◢ Generating your files    SyntaxError: Unexpected token, expected "," (30:63)
      28 |                     },
      29 |                     async resolve(_root, args, ctx) {
    > 30 |                       return ctx.prisma.user.findFirst(argsas any)
         |                                                               ^
      31 |                     },
      32 |                   })
      33 | t.crud.users({ filtering: true, ordering: true })
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
$ pal --version
@paljs/cli/2.9.3 darwin-x64 node-v12.20.0

Am I missing anything?

Cheers

AhmedElywa commented 3 years ago

No you are right it's issue will fix soon

mohsinamjad commented 3 years ago

+1

AhmedElywa commented 3 years ago

This issue fixed in the last release v2.10, please upgrade to this version.