question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot determine output type of decimal (prisma decimal) parameter

See original GitHub issue

If we have decimal type in model, nest server fails to start stating that it cannot determine output type of decimal parameter.

I am using classes generated by this packages.

Any guidance will be appreciated.

P.S. Awesome work btw!

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
unlightcommented, Mar 30, 2022

Typescript does not complain about anything, looks like decimal input/output class is missing decorators as nestjs complains about it.

yes, usually it happends when package versions mismmatch or missing package or missing reflect-metadata package.

Please let me know how i can provide more information regarding this issue.

I need steps to reproduce the issue - minimal repo with prisma schema, example nest application

You can fork https://github.com/unlight/prisma-nestjs-graphql and make changes in example application (see folder example)

0reactions
unlightcommented, Mar 30, 2022

My steps:

  1. git clone https://github.com/mubaidr/prisma-nestjs-graphql.git
  2. cd prisma-nestjs-graphql
  3. npm i
  4. npm run regen
  5. set DATABASE_URL=postgresql://postgres@127.0.0.1:5432/prisma_nest
  6. npm run example
[INFO] 22:09:58 ts-node-dev ver. 1.1.8 (using ts-node ver. 9.1.1, typescript ver. 4.6.3)
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [NestFactory] Starting Nest application...
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] AppModule dependencies initialized +43ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] UserModule dependencies initialized +0ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] DummyModule dependencies initialized +1ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] AcademicsModule dependencies initialized +0ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +1ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [InstanceLoader] GraphQLModule dependencies initialized +1ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [GraphQLModule] Mapped {/graphql, POST} route +316ms
[Nest] 3648  - 03/30/2022, 10:10:02 PM     LOG [NestApplication] Nest application successfully started +2ms
Application is running on: http://[::1]:3000

No errors.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma throws type mismatch error using Decimal ... - GitHub
In your case, you are trying to assign Prisma's output to the external Decimal variable. However, the output did not change: even though...
Read more >
Prisma schema API (Reference)
Name, Required, Type, Description. provider, Yes, String ( postgresql , mysql , sqlite , sqlserver , mongodb , cockroachdb ), Describes which data...
Read more >
Why I am getting cannot determine GraphQL output error?
ArticleEntity should be decorated with the @ObjectType decorator as shown in the docs https://typegraphql.com/docs/types-and-fields.html.
Read more >
prisma is not assignable to type - You.com | The AI Search ...
Bug description. Prisma generates a namespace for Decimal.js that does not match the type from the import of Decimal.js from npm. This makes...
Read more >
nexus-prisma - npm
Official Prisma plugin for Nexus. Usage; Roadmap; Architecture; Features. Type-safe Generated Library Code; Project Enums; Project Scalars ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found