paljs / prisma-tools

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

pal generate creates a lot more files #119

Closed ralvs closed 4 years ago

ralvs commented 4 years ago

Hey guys. I'm using version 1.0.3 and today the command pal g starts creating lots of files like follow ...MaxAggregateOutputType ...MinAggregateOutputType ...SumAggregateOutputType ...AvgAggregateOutputType

How can I stop that?

My pal.js config is

module.exports = {
  backend: {
    generator: 'sdl',
    output: 'graphql/generated',
  },
}
AhmedElywa commented 4 years ago

Yes it’s because new features in new version 2.2.0 I will upgrade now to feat new version of Prisma

ralvs commented 4 years ago

Ok, @AhmedElywa , understood. So I think the problem is, I did not enable the experimental flag for aggregations

generator client {
  provider = "prisma-client-js"
  // experimentalFeatures = ["aggregateApi"]
}

And when Paljs creates all these types, I get a lot of erros like unknown type

Unknown type "ExpenseMaxAggregateOutputTypeWhereInput". Did you mean "ExpenseMaxAggregateOutputType", "ExpenseMinAggregateOutputType", "ExpenseAvgAggregateOutputType", "ExpenseSumAggregateOutputType", or "NfeMaxAggregateOutputType"?

AhmedElywa commented 4 years ago

@ralvs thanks for your report please use the last version of @paljs/cli v1.0.6 will fix this issue

ralvs commented 4 years ago

Great @AhmedElywa ! I have fixed that downgrading to prisma v2.1.3 Will try update prisma and paljs now. Thanks

AhmedElywa commented 4 years ago

@ralvs v1.1.1 support adding aggregate