Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encountered a JSON parsing error due to an extraneous comma in a TypeGraphQL decorator. #433

Open
ivatra opened this issue Dec 26, 2023 · 0 comments
Labels
bug Something isn't working community Something initiated by the community

Comments

@ivatra
Copy link

ivatra commented Dec 26, 2023

Describe the Bug
I met this error when tried to remigrate typegraphql-schema after a while. I have been searching for this error reason for several hours until i have found i set a comma with nothing after that in

@TypeGraphQL.omit(input: true,)

doc line. I suppose it won't be hard to add a additional check for comma and prevent other users from spending a lot of time for that minor mistake.

To Reproduce

model Key {
  id        Int       @id @default(autoincrement())
  /// @TypeGraphQL.omit(input: true,)
  key       String    @unique

  @@map(name: "keys")
}

Expected Behavior
Should ignore comma or give understandable feedback about a comma with nothing after.

Logs

✔ Generated Prisma Client (v5.7.1) to .\node_modules\@prisma\client in 172ms
"undefined" is not valid JSON

Environment

  • OS: Windows 10
  • Node: 20.9.0
  • typegraphql-prisma version: 2.0.0-beta.2
  • Prisma version: 5.7.0
  • TypeScript version: 5.1.3
@MichalLytek MichalLytek added bug Something isn't working community Something initiated by the community labels Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community Something initiated by the community
Projects
None yet
Development

No branches or pull requests

2 participants