Closed terion-name closed 3 years ago
Migrating to 4th version, while testing got strange error. Updated all libs (see below) but it didn't help.
Libs:
"@paljs/generator": "^4.0.12", "@paljs/plugins": "^4.0.8", "@paljs/schema": "^4.0.6", "@prisma/client": "^3.1.1", "@prisma/debug": "^3.1.1", "@prisma/sdk": "^3.1.1",
Compiled client:
/** * Prisma Client JS version: 3.1.1 * Query Engine version: b8c35d44de987a9691890b3ddf3e2e7effb9bf20 */ Prisma.prismaVersion = { client: "3.1.1", engine: "b8c35d44de987a9691890b3ddf3e2e7effb9bf20" }
Given operation:
const gql = require("graphql-tag"); module.exports = { "query": gql`query categoriesQuery($where: CategoryWhereInput, $orderBy: [CategoryOrderByWithRelationInput!], $cursor: CategoryWhereUniqueInput, $distinct: [CategoryScalarFieldEnum!], $skip: Int, $take: Int) { categories( where: $where orderBy: $orderBy cursor: $cursor distinct: $distinct skip: $skip take: $take ) { ...CategoryFlat } } fragment CategoryFlat on Category { id slug color display createdAt updatedAt } `, "variables": { "where": { "id": { "notIn": "ckucnhmy200002tsd3bpy270m" }, "translations": { "some": {} }, "display": { "in": "ACTIVE", "notIn": "INACTIVE" } }, "orderBy": [ { "surveys": { "_count": "asc" } } ] }, "fetchPolicy": "no-cache" }
Where CategoryOrderByWithRelationInput is:
input CategoryOrderByWithRelationInput { id: SortOrder slug: SortOrder color: SortOrder translations: CategoryTranslationOrderByRelationAggregateInput display: SortOrder surveys: SurveyOrderByRelationAggregateInput }
And resolver is default:
categories: (_parent, args, { prisma }) => { return prisma.category.findMany(args) },
Results in:
Invalid `prisma.category.findMany()` invocation: { where: { id: { notIn: [ 'ckucnhmy200002tsd3bpy270m' ] }, translations: { some: {} }, display: { in: [ 'ACTIVE' ], notIn: [ 'INACTIVE' ] } }, orderBy: [ { surveys: { ~~~~~~~ _count: 'asc' } } ], select: { id: true, slug: true, color: true, display: true, createdAt: true, updatedAt: true } } Unknown arg `surveys` in orderBy.0.surveys for type CategoryOrderByInput. Did you mean `select`? Available args: type CategoryOrderByInput { id?: SortOrder slug?: SortOrder color?: SortOrder display?: SortOrder createdAt?: SortOrder updatedAt?: SortOrder }
Why prisma client knows nothing about CategoryOrderByWithRelationInput?
CategoryOrderByWithRelationInput
Sorry, forgot to update prisma dep
Migrating to 4th version, while testing got strange error. Updated all libs (see below) but it didn't help.
Libs:
Compiled client:
Given operation:
Where CategoryOrderByWithRelationInput is:
And resolver is default:
Results in:
Why prisma client knows nothing about
CategoryOrderByWithRelationInput
?