Skip to content

v4.0.0

Choose a tag to compare

@AhmedElywa AhmedElywa released this 09 Sep 19:05
· 181 commits to main since this release

Breaking changes

  • Must have Prisma version 3.x not working with Prisma 2.x to work with Prisma 2.x use Pal.Js 3.x.
  • distinct Input arg into findMany, findCount, findFirst now is array of enums
  • orderBy input arg into findMany, findCount, findFirst, aggregate his name was changed.
export const UserFindFirstQuery = queryField('findFirstUser', {
  type: 'User',
  args: {
    where: 'UserWhereInput',
-   orderBy: list('UserOrderByInput'),
+   orderBy: list('UserOrderByWithRelationInput'),
    cursor: 'UserWhereUniqueInput',
    take: 'Int',
    skip: 'Int',
-   distinct: 'UserScalarFieldEnum',
+   distinct: list('UserScalarFieldEnum'),
  },
  resolve(_parent, args, { prisma, select }) {
    return prisma.user.findFirst({
      ...args,
      ...select,
    })
  },
})

Upgrade guide

nexus generator

In nexus we do not write on the queries or mutations files you must delete these files if you did not have any custom work on it and re-run pal g again. Or if you have some custom work on these files you will need to go inside these files and change the args as we show in the diff code

SDL generator

In SDL generator we rewrite on the typeDef file to apply the changes coming from prisma schema so all you need to do is pal g and our script will update the types for you