Nexus-plugin-prisma: Enums not working properly

Created on 20 Aug 2019  路  5Comments  路  Source: graphql-nexus/nexus-plugin-prisma

Version: [email protected]

When using enums and querying it, it throws an error photon[mapping.plural].findOne(...)[graphqlField.name] is not a function

enum PricingType {
  NET
  SELLING
}

model Pricing {
  id    String      @default(cuid()) @id @unique
  type  PricingType
  adult Float
  child Float
}

Also types are probably not generated correctly
Screenshot 2019-08-20 at 21 50 41

typbug

Most helpful comment

@janpio thanks! Yep, moving this one to nexus-prisma repo 馃憤

@malekjaroslav 馃憢 a release will be made this week

All 5 comments

I believe this is an error with @prisma/nexus. It appears that the fix has been merged in to the next version of @prisma/nexus, but I'm not exactly sure how you'd install it using npm. https://github.com/prisma/nexus-prisma/pull/353

@CaptainChemist Yeah, also just found it. But I was unsuccessful installing it. Probably will need to wait for a release.

Ping @jasonkuhrt for confirmation.

@janpio thanks! Yep, moving this one to nexus-prisma repo 馃憤

@malekjaroslav 馃憢 a release will be made this week

Duplicate of #327 resolved by #353

Was this page helpful?
0 / 5 - 0 ratings